Simplify and fix siteSetting instantiation
parent
6cebd8618d
commit
fe9a4a134b
|
@ -362,14 +362,7 @@ async function main(eventInfo) {
|
|||
// Get user's settings for the wiki
|
||||
let settings = storage.wikiSettings || {};
|
||||
let id = site['id'];
|
||||
let siteSetting = '';
|
||||
if (settings.hasOwnProperty(id)) {
|
||||
siteSetting = settings[id];
|
||||
} else if (storage.defaultWikiAction) {
|
||||
siteSetting = storage.defaultWikiAction;
|
||||
} else {
|
||||
siteSetting = 'alert';
|
||||
}
|
||||
let siteSetting = settings[id] || storage.defaultWikiAction || 'alert';
|
||||
// Check if redirects are enabled for the site
|
||||
if (siteSetting === 'redirect') {
|
||||
// Get article name from the end of the URL;
|
||||
|
|
|
@ -252,14 +252,7 @@ function main() {
|
|||
// Get user's settings for the wiki
|
||||
let settings = storage.wikiSettings || {};
|
||||
let id = site['id'];
|
||||
let siteSetting = '';
|
||||
if (settings.hasOwnProperty(id)) {
|
||||
siteSetting = settings[id];
|
||||
} else if (storage.defaultActionSettings && storage.defaultActionSettings[site.language]) {
|
||||
siteSetting = storage.defaultActionSettings[site.language];
|
||||
} else {
|
||||
siteSetting = 'alert';
|
||||
}
|
||||
let siteSetting = settings[id] || storage.defaultWikiAction || 'alert';
|
||||
// Notify if enabled for the wiki:
|
||||
if (siteSetting === 'alert') {
|
||||
// Get article name from the end of the URL;
|
||||
|
|
Loading…
Reference in New Issue