You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/helpers/selectedApi/index.tsx

14 lines
350 B

import { isValidEnv } from 'config/env'
export const SELECTED_API_KEY = 'selected_api'
export const readSelectedApi = () => {
const rawValue = localStorage.getItem(SELECTED_API_KEY)
if (!rawValue) return null
const selectedApi = JSON.parse(rawValue)
if (selectedApi && isValidEnv(selectedApi)) {
return selectedApi
}
return null
}