feat: remember listing delete preference (#314)

* feat: remember listing delete preference

Persist soft/hard choice and skip-confirm in user settings.
This commit is contained in:
Ramin
2026-06-02 10:23:45 +02:00
committed by GitHub
parent b56e13aa16
commit f1b8709ab7
9 changed files with 206 additions and 42 deletions

View File

@@ -349,6 +349,20 @@ export const useFredyState = create(
throw Exception;
}
},
async setListingDeletionPreference(listing_deletion_preference) {
try {
await xhrPost('/api/user/settings/listing-deletion-preference', { listing_deletion_preference });
set((state) => ({
userSettings: {
...state.userSettings,
settings: { ...state.userSettings.settings, listing_deletion_preference },
},
}));
} catch (Exception) {
console.error('Error while trying to update listing deletion preference. Error:', Exception);
throw Exception;
}
},
},
};