refactor: use alerts module

This commit is contained in:
Barış Soner Uşaklı
2021-12-06 12:45:35 -05:00
parent 8cbe0df2e5
commit 1980feed46
22 changed files with 112 additions and 96 deletions

View File

@@ -13,10 +13,11 @@ define('forum/topic', [
'storage',
'hooks',
'api',
'alerts',
], function (
infinitescroll, threadTools, postTools,
events, posts, navigator, sort,
components, storage, hooks, api
components, storage, hooks, api, alerts
) {
const Topic = {};
let currentUrl = '';
@@ -113,7 +114,7 @@ define('forum/topic', [
!config.usePagination ||
(config.usePagination && ajaxify.data.pagination.currentPage === 1)
) && ajaxify.data.postcount > ajaxify.data.bookmarkThreshold) {
app.alert({
alerts.alert({
alert_id: 'bookmark',
message: '[[topic:bookmark_instructions]]',
timeout: 0,
@@ -126,7 +127,7 @@ define('forum/topic', [
},
});
setTimeout(function () {
app.removeAlert('bookmark');
alerts.remove('bookmark');
}, 10000);
}
}