enhance(phone/settings): Added labels to settings and misc cleanup

This change alters the default localStorage schema, please clear your localStorage cache for testing
This commit is contained in:
Taso authored and Taso committed 2021-03-04 11:33:25 -05:00
1 parent 5969d33dc3
commit 64c4e0ec16
11 files changed
+290 -210

No files matched your search

+4 -4
View File
@@ -3,25 +3,25 @@ import { getNotificationPath, getRingtonePath } from '../../../apps/settings/uti
const getPath = {
ringtone: getRingtonePath,
notification: getNotificationPath,
notiSound: getNotificationPath,
};
/**
* Gets the configuration for SoundProvider based on settings and apps
*/
export const getSoundSettings = (
type: 'ringtone' | 'notification',
type: 'ringtone' | 'notiSound',
settings: IPhoneSettings,
app?: string,
) => {
try {
return app
? {
sound: getPath[type](settings[`${app}_${type}`] || settings[type]),
sound: getPath[type](settings[`${app}_${type}`].value || settings[type].value),
volume: (settings[`${app}_${type}Vol`] || settings[`${type}Vol`]) / 100,
}
: {
sound: getPath[type](settings[type]),
sound: getPath[type](settings[type as string].value),
volume: settings[`${type}Vol`] / 100,
};
} catch (e) {