Skip to content

Commit a5879cb

Browse files
committed
feat: refresh mentions view when new mentions come in
1 parent 103c10e commit a5879cb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/views/Mentions.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ export default {
120120
$router.replace({ name: $route.name, params: $route.params, query: query })
121121
}
122122
123+
const refreshMentions = () => mentionsApi.page({
124+
limit: $route.query.limit || localStoragePrefs().data.posts_per_page,
125+
page: $route.query.page || 1,
126+
extended: true
127+
}).then(d => v.mentionData = d).catch(() => {})
128+
123129
const dismissNotifications = params => NotificationsStore.dismiss(params)
124130
const deleteMention = params => NotificationsStore.deleteMention(params)
125131
@@ -133,9 +139,7 @@ export default {
133139
defaultAvatarShape: window.default_avatar_shape,
134140
})
135141
136-
// nextTick(() => v.searchInput.focus())
137-
// // Updates page input when user uses header search
138-
// watch(() => $route.query.search, s => v.search = s)
142+
watch(() => NotificationsStore.mentionsList, () => refreshMentions())
139143
140144
return { ...toRefs(v), humanDate, pageResults, dismissNotifications, deleteMention }
141145
}

0 commit comments

Comments
 (0)