diff options
author | Sebastian <sebasjm@gmail.com> | 2024-03-07 09:34:06 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-03-07 09:34:28 -0300 |
commit | 2b76e32d5714fc410085b5a5ab5c1f4333190fe6 (patch) | |
tree | f890abb9b01c240561d29d489b345b0350b60e7a /packages/web-util/src/hooks/useNotifications.ts | |
parent | b059cf4b16663ef2db70a2c2d7af0a6ba5ce2688 (diff) | |
download | wallet-core-2b76e32d5714fc410085b5a5ab5c1f4333190fe6.tar.xz |
time component
Diffstat (limited to 'packages/web-util/src/hooks/useNotifications.ts')
-rw-r--r-- | packages/web-util/src/hooks/useNotifications.ts | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/packages/web-util/src/hooks/useNotifications.ts b/packages/web-util/src/hooks/useNotifications.ts index d8a927461..000abbc94 100644 --- a/packages/web-util/src/hooks/useNotifications.ts +++ b/packages/web-util/src/hooks/useNotifications.ts @@ -32,7 +32,7 @@ const storage = memoryMap<Map<string, NotificationMessage>>(); const NOTIFICATION_KEY = "notification"; export const GLOBAL_NOTIFICATION_TIMEOUT = Duration.fromSpec({ - minutes: 2, + seconds: 5, }); function removeFromStorage(n: NotificationMessage) { @@ -164,11 +164,11 @@ export function useLocalNotification(): [ const notif = !value ? undefined : { - message: value, - remove: () => { - setter(undefined); - }, - }; + message: value, + remove: () => { + setter(undefined); + }, + }; async function errorHandling(cb: (notify: typeof errorMap) => Promise<void>) { try { @@ -194,8 +194,8 @@ type HandlerMaker = <T extends OperationResult<A, B>, A, B>( onOperationSuccess: | ((result: T extends OperationOk<any> ? T : never) => void) | (( - result: T extends OperationOk<any> ? T : never, - ) => TranslatedString | undefined), + result: T extends OperationOk<any> ? T : never, + ) => TranslatedString | undefined), onOperationFail: ( d: T extends OperationFail<any> ? T : never, ) => TranslatedString, @@ -211,19 +211,19 @@ export function useLocalNotificationHandler(): [ const notif = !value ? undefined : { - message: value, - remove: () => { - setter(undefined); - }, - }; + message: value, + remove: () => { + setter(undefined); + }, + }; function makeHandler<T extends OperationResult<A, B>, A, B>( onClick: () => Promise<T | undefined>, onOperationSuccess: | ((result: T extends OperationOk<any> ? T : never) => void) | (( - result: T extends OperationOk<any> ? T : never, - ) => TranslatedString | undefined), + result: T extends OperationOk<any> ? T : never, + ) => TranslatedString | undefined), onOperationFail: ( d: T extends OperationFail<any> ? T : never, ) => TranslatedString, |