aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/utils')
-rw-r--r--subprojects/frontend/src/utils/CancelledError.ts6
-rw-r--r--subprojects/frontend/src/utils/PendingTask.ts7
-rw-r--r--subprojects/frontend/src/utils/PriorityMutex.ts6
-rw-r--r--subprojects/frontend/src/utils/TimeoutError.ts6
-rw-r--r--subprojects/frontend/src/utils/getLogger.ts6
-rw-r--r--subprojects/frontend/src/utils/useDelayedSnackbar.ts7
6 files changed, 36 insertions, 2 deletions
diff --git a/subprojects/frontend/src/utils/CancelledError.ts b/subprojects/frontend/src/utils/CancelledError.ts
index ee23676f..96b67af7 100644
--- a/subprojects/frontend/src/utils/CancelledError.ts
+++ b/subprojects/frontend/src/utils/CancelledError.ts
@@ -1,3 +1,9 @@
1/*
2 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
3 *
4 * SPDX-License-Identifier: EPL-2.0
5 */
6
1export default class CancelledError extends Error { 7export default class CancelledError extends Error {
2 constructor(message = 'Operation cancelled') { 8 constructor(message = 'Operation cancelled') {
3 super(message); 9 super(message);
diff --git a/subprojects/frontend/src/utils/PendingTask.ts b/subprojects/frontend/src/utils/PendingTask.ts
index fd52cef1..80d1a346 100644
--- a/subprojects/frontend/src/utils/PendingTask.ts
+++ b/subprojects/frontend/src/utils/PendingTask.ts
@@ -1,3 +1,9 @@
1/*
2 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
3 *
4 * SPDX-License-Identifier: EPL-2.0
5 */
6
1import TimeoutError from './TimeoutError'; 7import TimeoutError from './TimeoutError';
2import getLogger from './getLogger'; 8import getLogger from './getLogger';
3 9
@@ -20,7 +26,6 @@ export default class PendingTask<T> {
20 ) { 26 ) {
21 this.resolveCallback = resolveCallback; 27 this.resolveCallback = resolveCallback;
22 this.rejectCallback = rejectCallback; 28 this.rejectCallback = rejectCallback;
23 // @ts-expect-error See https://github.com/mobxjs/mobx/issues/3582 on `@types/node` pollution
24 this.timeout = setTimeout(() => { 29 this.timeout = setTimeout(() => {
25 if (!this.resolved) { 30 if (!this.resolved) {
26 this.reject(new TimeoutError()); 31 this.reject(new TimeoutError());
diff --git a/subprojects/frontend/src/utils/PriorityMutex.ts b/subprojects/frontend/src/utils/PriorityMutex.ts
index 78736141..c1215c76 100644
--- a/subprojects/frontend/src/utils/PriorityMutex.ts
+++ b/subprojects/frontend/src/utils/PriorityMutex.ts
@@ -1,3 +1,9 @@
1/*
2 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
3 *
4 * SPDX-License-Identifier: EPL-2.0
5 */
6
1import CancelledError from './CancelledError'; 7import CancelledError from './CancelledError';
2import PendingTask from './PendingTask'; 8import PendingTask from './PendingTask';
3import getLogger from './getLogger'; 9import getLogger from './getLogger';
diff --git a/subprojects/frontend/src/utils/TimeoutError.ts b/subprojects/frontend/src/utils/TimeoutError.ts
index eb800f40..21365502 100644
--- a/subprojects/frontend/src/utils/TimeoutError.ts
+++ b/subprojects/frontend/src/utils/TimeoutError.ts
@@ -1,3 +1,9 @@
1/*
2 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
3 *
4 * SPDX-License-Identifier: EPL-2.0
5 */
6
1export default class TimeoutError extends Error { 7export default class TimeoutError extends Error {
2 constructor() { 8 constructor() {
3 super('Operation timed out'); 9 super('Operation timed out');
diff --git a/subprojects/frontend/src/utils/getLogger.ts b/subprojects/frontend/src/utils/getLogger.ts
index 301fd76d..09b0b17f 100644
--- a/subprojects/frontend/src/utils/getLogger.ts
+++ b/subprojects/frontend/src/utils/getLogger.ts
@@ -1,3 +1,9 @@
1/*
2 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
3 *
4 * SPDX-License-Identifier: EPL-2.0
5 */
6
1import styles, { type CSPair } from 'ansi-styles'; 7import styles, { type CSPair } from 'ansi-styles';
2import log from 'loglevel'; 8import log from 'loglevel';
3import prefix from 'loglevel-plugin-prefix'; 9import prefix from 'loglevel-plugin-prefix';
diff --git a/subprojects/frontend/src/utils/useDelayedSnackbar.ts b/subprojects/frontend/src/utils/useDelayedSnackbar.ts
index 54716c0c..3d6df3e3 100644
--- a/subprojects/frontend/src/utils/useDelayedSnackbar.ts
+++ b/subprojects/frontend/src/utils/useDelayedSnackbar.ts
@@ -1,3 +1,9 @@
1/*
2 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
3 *
4 * SPDX-License-Identifier: EPL-2.0
5 */
6
1import { 7import {
2 useSnackbar, 8 useSnackbar,
3 type SnackbarKey, 9 type SnackbarKey,
@@ -21,7 +27,6 @@ export default function useDelayedSnackbar(
21 delay = defaultDelay, 27 delay = defaultDelay,
22 ) => { 28 ) => {
23 let key: SnackbarKey | undefined; 29 let key: SnackbarKey | undefined;
24 // @ts-expect-error See https://github.com/mobxjs/mobx/issues/3582 on `@types/node` pollution
25 let timeout: number | undefined = setTimeout(() => { 30 let timeout: number | undefined = setTimeout(() => {
26 timeout = undefined; 31 timeout = undefined;
27 key = enqueueSnackbar(message, options); 32 key = enqueueSnackbar(message, options);