summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLASER-Yi <[email protected]>2021-06-10 10:20:23 +0800
committerLASER-Yi <[email protected]>2021-06-10 10:20:23 +0800
commit8d447453e9f2daada8e4df4365ffad1b308a24e2 (patch)
tree6183008e9ffcac15c489da275d25f5c872327015
parentac8f5c0ca5856c085b361f33735a89fb8239ff9f (diff)
downloadbazarr-8d447453e9f2daada8e4df4365ffad1b308a24e2.tar.gz
bazarr-8d447453e9f2daada8e4df4365ffad1b308a24e2.zip
no log: Remove useSessionStorage from utility hooks
-rw-r--r--frontend/src/utilites/hooks.ts18
1 files changed, 1 insertions, 17 deletions
diff --git a/frontend/src/utilites/hooks.ts b/frontend/src/utilites/hooks.ts
index 532d60227..ea1303efa 100644
--- a/frontend/src/utilites/hooks.ts
+++ b/frontend/src/utilites/hooks.ts
@@ -1,4 +1,4 @@
-import React, { useCallback, useMemo } from "react";
+import { useCallback, useMemo } from "react";
import { useHistory } from "react-router";
import { useDidUpdate } from "rooks";
import { getBaseUrl } from ".";
@@ -28,22 +28,6 @@ export function useHasUpdateInject() {
}
}
-export function useSessionStorage(
- key: string
-): [StorageType, React.Dispatch<StorageType>] {
- const dispatch: React.Dispatch<StorageType> = useCallback(
- (value) => {
- if (value !== null) {
- sessionStorage.setItem(key, value);
- } else {
- sessionStorage.removeItem(key);
- }
- },
- [key]
- );
- return [sessionStorage.getItem(key), dispatch];
-}
-
export function useOnLoadingFinish(
state: Readonly<AsyncState<any>>,
callback: () => void