mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 05:17:51 +08:00
showing errors when saving config
This commit is contained in:
parent
9a25f22a0b
commit
6d9fbec7a2
1 changed files with 7 additions and 2 deletions
|
@ -500,10 +500,15 @@ export function updateLbMemory(mode, mode2, type, value) {
|
|||
export async function saveConfig(config) {
|
||||
if (firebase.auth().currentUser !== null) {
|
||||
AccountButton.loading(true);
|
||||
let response;
|
||||
try {
|
||||
let response = await axiosInstance.post("/config/save", { config });
|
||||
response = await axiosInstance.post("/config/save", { config });
|
||||
} catch (e) {
|
||||
Notifications.add(e.message, -1);
|
||||
AccountButton.loading(false);
|
||||
|
||||
let msg = e?.response?.data?.message ?? e.message;
|
||||
Notifications.add("Failed to save config: " + msg, -1);
|
||||
return;
|
||||
}
|
||||
AccountButton.loading(false);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue