aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src/hooks/useNotifications.ts
diff options
context:
space:
mode:
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,