import localstorage from '~/services/localStorage';
import { LOCALSTORAGE_ACCOUNT_KEY } from './constants';
import { setViewed } from './';

export default async () => {
  const state = await localstorage.get(LOCALSTORAGE_ACCOUNT_KEY);
  if (!state) {
    return false;
  }
  if (state.viewed) {
    setViewed();
  }
  return true;
};
