Skip to content

Commit

Permalink
Display message to save config when firefox private browsing (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
tilfin authored Oct 31, 2023
1 parent 31dbab5 commit f0c2cce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/js/lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class DBManager {
}
};
openReq.onerror = (event) => {
reject(`Error opening database: ${event.target.error}`);
reject(event.target.error);
};
});
}
Expand Down
6 changes: 5 additions & 1 deletion src/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ window.onload = function() {
}, 2500);
})
.catch(lastError => {
updateMessage(msgSpan, lastError.message, 'warn');
let msg = lastError.message
if (lastError.message === "A mutation operation was attempted on a database that did not allow mutations.") {
msg = "Configuration cannot be saved while using Private Browsing."
}
updateMessage(msgSpan, msg, 'warn');
});
} catch (e) {
updateMessage(msgSpan, `Failed to save because ${e.message}`, 'warn');
Expand Down

0 comments on commit f0c2cce

Please sign in to comment.