Web: prevent error when notification popover is empty

This commit is contained in:
Sybren A. Stüvel 2022-05-19 14:06:50 +02:00
parent d5e5e7b566
commit 034d75a9b8
2 changed files with 4 additions and 0 deletions

View File

@ -46,6 +46,7 @@ onMounted(() => {
});
function _scrollToBottom() {
if (notifs.empty) return;
tabulator.scrollToRow(notifs.lastID, "bottom", false);
}
function _subscribeToPinia() {

View File

@ -22,6 +22,9 @@ export const useNotifs = defineStore('notifications', {
hideTimerID: 0,
lastID: 0,
}),
getters: {
empty: (state) => state.history.length == 0,
},
actions: {
/**
* Add a simple notification.