From 7acad9b0f3977f019706d1d8d0972e5e8efc97b9 Mon Sep 17 00:00:00 2001 From: djmil Date: Fri, 10 Nov 2023 13:25:24 +0100 Subject: [PATCH] namedStorage instead of useStorage --- webapp/src/reducer/polling.js | 4 ++-- webapp/src/util/PersistentStorage.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/src/reducer/polling.js b/webapp/src/reducer/polling.js index 521f5c7..750f2ca 100644 --- a/webapp/src/reducer/polling.js +++ b/webapp/src/reducer/polling.js @@ -1,9 +1,9 @@ import { useReducer } from 'react'; -import { useLocalStorage } from '../util/PersistentStorage'; +import { namedLocalStorage } from '../util/PersistentStorage'; import { nextState } from '../util/StateHelper'; const Persistent = (() => { - const [getEnabled, setEnabled] = useLocalStorage('polling.enabled', true); + const [getEnabled, setEnabled] = namedLocalStorage('polling.enabled', true); return { getEnabled, diff --git a/webapp/src/util/PersistentStorage.js b/webapp/src/util/PersistentStorage.js index ea44750..3745cdc 100644 --- a/webapp/src/util/PersistentStorage.js +++ b/webapp/src/util/PersistentStorage.js @@ -1,4 +1,4 @@ -export function useLocalStorage(name, initialValue) { +export function namedLocalStorage(name, initialValue) { const get = () => localStorage.getItem(name); const del = () => localStorage.removeItem(name); @@ -14,7 +14,7 @@ export function useLocalStorage(name, initialValue) { return [get, set, del] } -export function useSessionStorage(name, initialValue) { +export function namedSessionStorage(name, initialValue) { const get = () => sessionStorage.getItem(name); const del = () => sessionStorage.removeItem(name);