Revert "fix: only show email confirmation warning toast on pages that it applies"

This reverts commit 1bd1cc74a4.
isekai-main
Julian Lam 3 years ago
parent 0728a99453
commit 5a328485dd

@ -97,6 +97,7 @@ app.cacheBuster = null;
});
createHeaderTooltips();
app.showEmailConfirmWarning();
app.showCookieWarning();
registerServiceWorker();
@ -754,24 +755,7 @@ app.cacheBuster = null;
app.showEmailConfirmWarning = async (err) => {
const storage = await app.require('storage');
let showModal = false;
switch (ajaxify.data.template.name) {
case 'recent': {
showModal = !ajaxify.data.canPost;
break;
}
case 'category': {
showModal = !ajaxify.data.privileges['topics:create'];
break;
}
case 'topic': {
showModal = !ajaxify.data.privileges['topics:reply'];
}
}
if (!showModal || !app.user.uid || parseInt(storage.getItem('email-confirm-dismiss'), 10) === 1) {
if (!app.user.uid || parseInt(storage.getItem('email-confirm-dismiss'), 10) === 1) {
return;
}
const msg = {

@ -48,8 +48,6 @@ define('forum/category', [
},
});
app.showEmailConfirmWarning();
hooks.fire('action:topics.loaded', { topics: ajaxify.data.topics });
hooks.fire('action:category.loaded', { cid: ajaxify.data.cid });
};

@ -7,7 +7,6 @@ define('forum/recent', ['topicList'], function (topicList) {
app.enterRoom('recent_topics');
topicList.init('recent');
app.showEmailConfirmWarning();
};
return Recent;

@ -74,7 +74,6 @@ define('forum/topic', [
$(window).on('scroll', updateTopicTitle);
handleTopicSearch();
app.showEmailConfirmWarning();
hooks.fire('action:topic.loaded', ajaxify.data);
};

Loading…
Cancel
Save