1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 14:31:44 +01:00

fix: removes fetch request when user does not exist (#2473)

This commit is contained in:
Amir Raminfar
2023-11-05 12:29:44 -08:00
committed by GitHub
parent 1d022b51b5
commit bb085affb2

View File

@@ -33,12 +33,14 @@ export const DEFAULT_SETTINGS: Settings = {
export const settings = useStorage(DOZZLE_SETTINGS_KEY, DEFAULT_SETTINGS);
settings.value = { ...DEFAULT_SETTINGS, ...settings.value, ...config.serverSettings };
watch(settings, (value) => {
fetch(withBase("/api/profile/settings"), {
method: "PUT",
body: JSON.stringify(value),
if (config.user) {
watch(settings, (value) => {
fetch(withBase("/api/profile/settings"), {
method: "PUT",
body: JSON.stringify(value),
});
});
});
}
export const {
collapseNav,