diff --git a/Quests/includes/Hooks.php b/Quests/includes/Hooks.php index 1e3c249..5976598 100644 --- a/Quests/includes/Hooks.php +++ b/Quests/includes/Hooks.php @@ -67,13 +67,5 @@ class Hooks { public static function onBeforePageDisplay(OutputPage $out, $skin) { $out->addModules(['ext.isekai.userpoints.quests.notification']); - - $sessionManager = SessionManager::getGlobalSession(); - if ($sessionManager->exists(QuestsUtils::SESSION_KEY_QUEST_COMPLETE_NOTIFICATION)) { - $out->addJsConfigVars([ - 'wgIsekaiQuestsCompleteNotification' => $sessionManager->get(QuestsUtils::SESSION_KEY_QUEST_COMPLETE_NOTIFICATION), - ]); - $sessionManager->remove(QuestsUtils::SESSION_KEY_QUEST_COMPLETE_NOTIFICATION); - } } } diff --git a/Quests/modules/ext.isekai.userpoints.quests.notification.js b/Quests/modules/ext.isekai.userpoints.quests.notification.js index 2d459b1..63622b4 100644 --- a/Quests/modules/ext.isekai.userpoints.quests.notification.js +++ b/Quests/modules/ext.isekai.userpoints.quests.notification.js @@ -52,18 +52,12 @@ function onQuestsCompleteNotification(notificationData) { mw.hook('postEdit').add(function (data) { console.log('onPostEdit'); - var notificationData = mw.config.get('wgIsekaiQuestsCompleteNotification'); - if (notificationData) { - onQuestsCompleteNotification(notificationData); - } else { - // VE,通过API获取消息 - var mwApi = new mw.Api(); - mwApi.get({ - action: 'userquestsgetnotification', - }).done(function (data) { - if (data.userquestsgetnotification && data.userquestsgetnotification.notification) { - onQuestsCompleteNotification(data.userquestsgetnotification.notification); - } - }); - } + var mwApi = new mw.Api(); + mwApi.get({ + action: 'userquestsgetnotification', + }).done(function (data) { + if (data.userquestsgetnotification && data.userquestsgetnotification.notification) { + onQuestsCompleteNotification(data.userquestsgetnotification.notification); + } + }); }); \ No newline at end of file