mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-07 00:14:25 +00:00
Fix settings not closing on submit bug
This commit is contained in:
@@ -64,10 +64,14 @@ export const saveUserSettings = async (settings) => {
|
||||
},
|
||||
body: JSON.stringify(settings),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to save user settings');
|
||||
const errorData = await response.json().catch(() => null);
|
||||
throw new Error(errorData?.message || `HTTP error! status: ${response.status}`);
|
||||
}
|
||||
return await response.json();
|
||||
|
||||
const savedSettings = await response.json();
|
||||
return savedSettings;
|
||||
} catch (error) {
|
||||
console.error('Error saving user settings:', error);
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user