// SPDX-License-Identifier: GPL-3.0-or-later
export const STORAGE = (() => {
- const _sessionStorage = {}
- Object.defineProperty(globalThis, 'sessionStorage', {
- value: {
- length: Object.entries(_sessionStorage).length,
- setItem: (key, value) => _sessionStorage[key] = value,
- getItem: (key) => _sessionStorage[key],
- removeItem: (key) => delete _sessionStorage[key],
- clear: () => _sessionStorage = {}
- },
- configurable: true,
- enumerable: true
- })
+ if (globalThis.sessionStorage == null) {
+ const _sessionStorage = {}
+ Object.defineProperty(globalThis, 'sessionStorage', {
+ value: {
+ length: Object.entries(_sessionStorage).length,
+ setItem: (key, value) => _sessionStorage[key] = value,
+ getItem: (key) => _sessionStorage[key],
+ removeItem: (key) => delete _sessionStorage[key],
+ clear: () => _sessionStorage = {}
+ },
+ configurable: true,
+ enumerable: true
+ })
+ }
})()
export const GENESIS_ADDRESS = 'nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3'