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:
parent
7135d06673
commit
f9e0ecdd0c
10 changed files with 148 additions and 21 deletions
|
@ -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,
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue