Skip to content

Commit

Permalink
fix: bg-error event
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Jul 25, 2024
1 parent 0d3e8ce commit fc1e8ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/ui/setting-text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ onBeforeUnmount(() => {
});
function onSave() {
options.set(props.name, savedValue = value.value).catch(bgError);
options.set(props.name, savedValue = value.value).then(bgError, bgError);
savedValueText = text.value;
isDirty.value = canSave.value = false;
saved.value = i18n('buttonSaved');
Expand All @@ -125,7 +125,7 @@ function onReset() {
el.focus();
if (!props.hasSave) {
// No save button = something rather trivial e.g. the export file name
options.set(props.name, defaultValue).catch(bgError);
options.set(props.name, defaultValue).then(bgError, bgError);
} else {
// Save button exists = let the user undo the input
el.select();
Expand All @@ -135,7 +135,7 @@ function onReset() {
}
}
function bgError(err) {
emit('bg-error', err);
emit('bg-error', err && JSON.parse(err.message));
}
</script>

Expand Down

0 comments on commit fc1e8ee

Please sign in to comment.