mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
wip
This commit is contained in:
@@ -205,7 +205,7 @@ export default function index() {
|
||||
);
|
||||
|
||||
let sections: Section[] = [];
|
||||
if (settings?.home === null || settings?.home?.sections === null) {
|
||||
if (!settings?.home || !settings?.home?.sections) {
|
||||
sections = useMemo(() => {
|
||||
if (!api || !user?.Id) return [];
|
||||
|
||||
|
||||
@@ -189,7 +189,14 @@ const loadSettings = (): Settings => {
|
||||
}
|
||||
};
|
||||
|
||||
const EXCLUDE_FROM_SAVE = ["home"];
|
||||
|
||||
const saveSettings = (settings: Settings) => {
|
||||
Object.keys(settings).forEach((key) => {
|
||||
if (EXCLUDE_FROM_SAVE.includes(key)) {
|
||||
delete settings[key as keyof Settings];
|
||||
}
|
||||
});
|
||||
const jsonValue = JSON.stringify(settings);
|
||||
storage.set("settings", jsonValue);
|
||||
};
|
||||
@@ -277,6 +284,7 @@ export const useSettings = () => {
|
||||
if (Object.keys(unlockedPluginDefaults).length > 0) {
|
||||
updateSettings(unlockedPluginDefaults);
|
||||
}
|
||||
|
||||
return {
|
||||
..._settings,
|
||||
...overrideSettings,
|
||||
|
||||
Reference in New Issue
Block a user