More robust setting checking for banners

pull/327/head
Kevin Payravi 2023-11-06 01:20:33 -06:00
parent fbb923635f
commit f8b085ced1
1 changed files with 6 additions and 2 deletions

View File

@ -262,8 +262,12 @@ function main() {
if (site) { if (site) {
// Get user's settings for the wiki // Get user's settings for the wiki
let id = site['id']; let id = site['id'];
let settings = storage.wikiSettings || {}; let siteSetting = 'alert';
let siteSetting = settings[id] || storage.defaultWikiAction || 'alert'; if (storage.wikiSettings && storage.wikiSettings[id]) {
siteSetting = storage.wikiSettings[id];
} else if (storage.defaultWikiAction) {
siteSetting = storage.defaultWikiAction;
}
// Notify if enabled for the wiki: // Notify if enabled for the wiki:
if (siteSetting === 'alert') { if (siteSetting === 'alert') {
// Get article name from the end of the URL; // Get article name from the end of the URL;