From 5c00d51c3ccf4f7c3a517010c964f2462b9fe713 Mon Sep 17 00:00:00 2001 From: Agustin Pane Date: Fri, 19 Jun 2020 12:21:24 -0300 Subject: [PATCH] Remove types on loadFromStorage --- .../Balances/SendModal/screens/SendFunds/index.tsx | 3 +-- src/utils/storage/index.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx index 1e40a01c..eafeea53 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx @@ -220,12 +220,11 @@ const SendFunds = ({ initialValues, onClose, onNext, recipientAddress, selectedT placeholder="Amount*" text="Amount*" type="text" - disabled={!selectedTokenRecord} validate={composeValidators( required, mustBeFloat, greaterThan(0), - maxValue(selectedTokenRecord?.balance), + maxValue(selectedTokenRecord && selectedTokenRecord.balance), )} /> diff --git a/src/utils/storage/index.ts b/src/utils/storage/index.ts index f1ff7dd1..127db6f7 100644 --- a/src/utils/storage/index.ts +++ b/src/utils/storage/index.ts @@ -10,7 +10,7 @@ export const storage = new ImmortalStorage(stores) const PREFIX = `v2_${getNetwork()}` -export const loadFromStorage = async (key: string): Promise => { +export const loadFromStorage = async (key) => { try { const stringifiedValue = await storage.get(`${PREFIX}__${key}`) if (stringifiedValue === null || stringifiedValue === undefined) { @@ -24,7 +24,7 @@ export const loadFromStorage = async (key: string): Promise => { } } -export const saveToStorage = async (key: string, value: any): Promise => { +export const saveToStorage = async (key, value) => { try { const stringifiedValue = JSON.stringify(value) await storage.set(`${PREFIX}__${key}`, stringifiedValue) @@ -33,7 +33,7 @@ export const saveToStorage = async (key: string, value: any): Promise => { } } -export const removeFromStorage = async (key: string): Promise => { +export const removeFromStorage = async (key) => { try { await storage.remove(`${PREFIX}__${key}`) } catch (err) {