mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Revert "feat(phone/settings): Add localStorage settings schema validation (#139)"
This reverts commit cb5a00e57e.
Reverted due a non-descript bug in CEF. Will be reapplied after fix.
This commit is contained in:
1 parent
da5694863a
commit
6419245d93
10 files changed
+43
-136
No files matched your search
@@ -52,7 +52,7 @@ export const NotificationsContext = createContext<{
|
||||
export function NotificationsProvider({ children }) {
|
||||
const isPhoneOpen = useRecoilValue(phoneState.visibility);
|
||||
|
||||
const { settings } = useSettings();
|
||||
const [settings] = useSettings();
|
||||
|
||||
const [barUncollapsed, setBarUncollapsed] = useState<boolean>(false);
|
||||
|
||||
@@ -110,7 +110,7 @@ export function NotificationsProvider({ children }) {
|
||||
(id: string): INotification | null => {
|
||||
return notifications.find((n) => n.id === id) || null;
|
||||
},
|
||||
[notifications],
|
||||
[notifications]
|
||||
);
|
||||
|
||||
const _showAlert = useCallback(
|
||||
@@ -149,13 +149,18 @@ export function NotificationsProvider({ children }) {
|
||||
}, DEFAULT_ALERT_HIDE_TIME + 300);
|
||||
});
|
||||
},
|
||||
[play],
|
||||
[play]
|
||||
);
|
||||
|
||||
const addNotificationAlert = (n: INotification, cb: (n: INotification) => void) => {
|
||||
const addNotificationAlert = (
|
||||
n: INotification,
|
||||
cb: (n: INotification) => void
|
||||
) => {
|
||||
if (n.sound) {
|
||||
const { sound, volume } = getSoundSettings('notiSound', settings, n.app);
|
||||
mount(sound, volume, false).then(({ url }) => setAlerts((curr) => [...curr, [n, cb, url]]));
|
||||
mount(sound, volume, false).then(({ url }) =>
|
||||
setAlerts((curr) => [...curr, [n, cb, url]])
|
||||
);
|
||||
return;
|
||||
}
|
||||
setAlerts((curr) => [...curr, [n, cb, undefined]]);
|
||||
|
||||
@@ -4,6 +4,6 @@ import { useSettings } from '../../../apps/settings/hooks/useSettings';
|
||||
import themes from '../../../config/themes.json';
|
||||
|
||||
export const usePhoneTheme = () => {
|
||||
const { settings } = useSettings();
|
||||
const [settings] = useSettings();
|
||||
return useMemo(() => createMuiTheme(themes[settings.theme.value]), [settings.theme]);
|
||||
};
|
||||
@@ -8,9 +8,7 @@ import { phoneState } from './state';
|
||||
export const usePhoneVisibility = () => {
|
||||
const [visibility, setVisibility] = useRecoilState(phoneState.visibility);
|
||||
const { currentAlert } = useNotifications();
|
||||
const {
|
||||
settings: { zoom },
|
||||
} = useSettings();
|
||||
const [{ zoom }] = useSettings();
|
||||
|
||||
const [notifVisibility, setNotifVisibility] = useState<boolean>(false);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getSoundSettings } from '../utils/getSoundSettings';
|
||||
import { useSoundProvider } from './useSoundProvider';
|
||||
|
||||
export const useRingtoneSound = () => {
|
||||
const { settings } = useSettings();
|
||||
const [settings] = useSettings();
|
||||
|
||||
const sound = useSoundProvider();
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@ export const getSoundSettings = (
|
||||
try {
|
||||
return app
|
||||
? {
|
||||
sound: getPath[type](settings[`${app}_${type}`]?.value || settings[type]?.value),
|
||||
sound: getPath[type](settings[`${app}_${type}`].value || settings[type].value),
|
||||
volume: (settings[`${app}_${type}Vol`] || settings[`${type}Vol`]) / 100,
|
||||
}
|
||||
: {
|
||||
sound: getPath[type](settings[type as string]?.value),
|
||||
sound: getPath[type](settings[type as string].value),
|
||||
volume: settings[`${type}Vol`] / 100,
|
||||
};
|
||||
} catch (e) {
|
||||
|
||||
Reference in new issue
Block a user