mars-v2-frontend/src/utils/checkAutoLendEnabled.ts

11 lines
409 B
TypeScript
Raw Normal View History

2023-10-23 12:04:17 +00:00
import { LocalStorageKeys } from 'constants/localStorageKeys'
export default function checkAutoLendEnabled(accountId: string, chainId: string) {
const storageItem = localStorage.getItem(
`${chainId}/${LocalStorageKeys.AUTO_LEND_ENABLED_ACCOUNT_IDS}`,
)
const autoLendEnabledAccountIds: string[] = storageItem ? JSON.parse(storageItem) : []
return autoLendEnabledAccountIds.includes(accountId)
}