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)) || [],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user