forked from DebaucheryLibrarian/traxxx
Adding alerted scene to stashes.
This commit is contained in:
@@ -34,7 +34,7 @@ function initUiActions(store, _router) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const { notifications } = await graphql(`
|
||||
const { notifications, unseenNotifications } = await graphql(`
|
||||
query Notifications(
|
||||
$hasAuth: Boolean!
|
||||
$userId: Int
|
||||
@@ -76,6 +76,11 @@ function initUiActions(store, _router) {
|
||||
}
|
||||
}
|
||||
}
|
||||
unseenNotifications: notificationsConnection(
|
||||
filter: { seen: { equalTo: false } }
|
||||
) {
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
`, {
|
||||
hasAuth: !!store.state.auth.user,
|
||||
@@ -85,7 +90,12 @@ function initUiActions(store, _router) {
|
||||
const curatedNotifications = notifications.map(notification => curateNotification(notification));
|
||||
|
||||
commit('setNotifications', curatedNotifications);
|
||||
return curatedNotifications;
|
||||
commit('setUnseenNotificationsCount', unseenNotifications.totalCount);
|
||||
|
||||
return {
|
||||
notifications: curatedNotifications,
|
||||
unseenCount: unseenNotifications.totalCount,
|
||||
};
|
||||
}
|
||||
|
||||
async function checkNotification(context, notificationId) {
|
||||
@@ -198,8 +208,8 @@ function initUiActions(store, _router) {
|
||||
});
|
||||
|
||||
return {
|
||||
releases: res.results.map(result => curateRelease(result.release)),
|
||||
actors: res.actors.map(actor => curateActor(actor)),
|
||||
releases: res?.results.map(result => curateRelease(result.release)) || [],
|
||||
actors: res?.actors.map(actor => curateActor(actor)) || [],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@ function setNotifications(state, notifications) {
|
||||
state.notifications = notifications;
|
||||
}
|
||||
|
||||
function setUnseenNotificationsCount(state, count) {
|
||||
state.unseenNotificationsCount = count;
|
||||
}
|
||||
|
||||
function setTagFilter(state, tagFilter) {
|
||||
state.tagFilter = tagFilter;
|
||||
}
|
||||
@@ -24,6 +28,7 @@ function setTheme(state, theme) {
|
||||
|
||||
export default {
|
||||
setNotifications,
|
||||
setUnseenNotificationsCount,
|
||||
setTagFilter,
|
||||
setRange,
|
||||
setBatch,
|
||||
|
||||
@@ -12,4 +12,5 @@ export default {
|
||||
sfw: storedSfw === 'true' || false,
|
||||
theme: storedTheme || deviceTheme,
|
||||
notifications: [],
|
||||
unseenNotificationsCount: 0,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user