Remove types on loadFromStorage

This commit is contained in:
Agustin Pane 2020-06-19 12:21:24 -03:00
parent 3283bf1dc6
commit 5c00d51c3c
2 changed files with 4 additions and 5 deletions

View File

@ -220,12 +220,11 @@ const SendFunds = ({ initialValues, onClose, onNext, recipientAddress, selectedT
placeholder="Amount*" placeholder="Amount*"
text="Amount*" text="Amount*"
type="text" type="text"
disabled={!selectedTokenRecord}
validate={composeValidators( validate={composeValidators(
required, required,
mustBeFloat, mustBeFloat,
greaterThan(0), greaterThan(0),
maxValue(selectedTokenRecord?.balance), maxValue(selectedTokenRecord && selectedTokenRecord.balance),
)} )}
/> />
<OnChange name="token"> <OnChange name="token">

View File

@ -10,7 +10,7 @@ export const storage = new ImmortalStorage(stores)
const PREFIX = `v2_${getNetwork()}` const PREFIX = `v2_${getNetwork()}`
export const loadFromStorage = async (key: string): Promise<any> => { export const loadFromStorage = async (key) => {
try { try {
const stringifiedValue = await storage.get(`${PREFIX}__${key}`) const stringifiedValue = await storage.get(`${PREFIX}__${key}`)
if (stringifiedValue === null || stringifiedValue === undefined) { if (stringifiedValue === null || stringifiedValue === undefined) {
@ -24,7 +24,7 @@ export const loadFromStorage = async (key: string): Promise<any> => {
} }
} }
export const saveToStorage = async (key: string, value: any): Promise<void> => { export const saveToStorage = async (key, value) => {
try { try {
const stringifiedValue = JSON.stringify(value) const stringifiedValue = JSON.stringify(value)
await storage.set(`${PREFIX}__${key}`, stringifiedValue) await storage.set(`${PREFIX}__${key}`, stringifiedValue)
@ -33,7 +33,7 @@ export const saveToStorage = async (key: string, value: any): Promise<void> => {
} }
} }
export const removeFromStorage = async (key: string): Promise<void> => { export const removeFromStorage = async (key) => {
try { try {
await storage.remove(`${PREFIX}__${key}`) await storage.remove(`${PREFIX}__${key}`)
} catch (err) { } catch (err) {