1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

notifications: added tabs to notification screen

This commit is contained in:
Fedor Katurov 2023-03-16 11:35:31 +06:00
parent 7135d06673
commit f9e0ecdd0c
10 changed files with 148 additions and 21 deletions

View file

@ -14,13 +14,13 @@ export const useNotificationSettings = () => {
enabled: settingsEnabled,
lastSeen,
lastDate,
isLoading: isLoadingSettings,
isLoading,
update,
refresh,
settings,
} = useNotificationSettingsRequest();
const enabled = !isLoadingSettings && !settingsError && settingsEnabled;
const enabled = !isLoading && !settingsError && settingsEnabled;
const hasNew =
enabled && !!lastDate && (!lastSeen || isAfter(lastDate, lastSeen));
@ -47,5 +47,6 @@ export const useNotificationSettings = () => {
markAsRead,
refresh,
update,
loading: isLoading,
};
};

View file

@ -66,7 +66,7 @@ export const useNotificationSettingsRequest = () => {
const refresh = useCallback(() => mutate(), [mutate]);
return {
isLoading,
isLoading: isLoading && !data,
error,
lastSeen:
data?.lastSeen && isValid(parseISO(data.lastSeen))