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(); createHeaderTooltips();
app.showEmailConfirmWarning();
app.showCookieWarning(); app.showCookieWarning();
registerServiceWorker(); registerServiceWorker();
@ -754,24 +755,7 @@ app.cacheBuster = null;
app.showEmailConfirmWarning = async (err) => { app.showEmailConfirmWarning = async (err) => {
const storage = await app.require('storage'); const storage = await app.require('storage');
let showModal = false; if (!app.user.uid || parseInt(storage.getItem('email-confirm-dismiss'), 10) === 1) {
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) {
return; return;
} }
const msg = { const msg = {

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

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

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

Loading…
Cancel
Save