aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src/hooks/useNotifications.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-03-07 09:34:06 -0300
committerSebastian <sebasjm@gmail.com>2024-03-07 09:34:28 -0300
commit2b76e32d5714fc410085b5a5ab5c1f4333190fe6 (patch)
treef890abb9b01c240561d29d489b345b0350b60e7a /packages/web-util/src/hooks/useNotifications.ts
parentb059cf4b16663ef2db70a2c2d7af0a6ba5ce2688 (diff)
downloadwallet-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.ts30
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,