WA-238 Refactor localStorage class allowing load data by key
This commit is contained in:
parent
7efcf44961
commit
302fc13613
|
@ -1,9 +1,10 @@
|
|||
// @flow
|
||||
const SAFES_KEY = 'SAFES'
|
||||
export const SAFES_KEY = 'SAFES'
|
||||
export const TX_KEY = 'TX'
|
||||
|
||||
export const loadSafes = () => {
|
||||
export const load = (key: string) => {
|
||||
try {
|
||||
const serializedState = localStorage.getItem(SAFES_KEY)
|
||||
const serializedState = localStorage.getItem(key)
|
||||
if (serializedState === null) {
|
||||
return undefined
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue