Skip to content

Commit

Permalink
fix: show a generic error when updating setting fails
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaros committed Mar 14, 2024
1 parent a320ca2 commit 0911535
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/settingsActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ const saveLocalizedAppearanceSetting = (d2, key, value, locale) => {
settingsActions.showSnackbarMessage(i18n.t('Settings updated'))
})
.catch((err) => {
settingsActions.showSnackbarMessage(
i18n.t(
'There was a problem updating settings. Changes have not been saved.'
)
)
console.error('Failed to save localized setting:', err)
})
}
Expand All @@ -38,6 +43,11 @@ const saveConfiguration = (d2, key, value) =>
settingsActions.showSnackbarMessage(i18n.t('Settings updated'))
})
.catch((err) => {
settingsActions.showSnackbarMessage(
i18n.t(
'There was a problem updating settings. Changes have not been saved.'
)
)
console.error('Failed to save configuration:', err)
})

Expand All @@ -48,6 +58,11 @@ const saveSetting = (d2, key, value) =>
settingsActions.showSnackbarMessage(i18n.t('Settings updated'))
})
.catch((err) => {
settingsActions.showSnackbarMessage(
i18n.t(
'There was a problem updating settings. Changes have not been saved.'
)
)
console.error('Failed to save setting:', err)
})

Expand Down

0 comments on commit 0911535

Please sign in to comment.