Skip to content

Commit

Permalink
Fix null bug (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
grod220 authored Mar 13, 2024
1 parent 4ef2ef7 commit 26503d7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/extension/src/routes/popup/popup-needs.ts
Original file line number Diff line number Diff line change
@@ -2,17 +2,19 @@ import { redirect } from 'react-router-dom';
import { PopupPath } from './paths';
import { localExtStorage, sessionExtStorage } from '@penumbra-zone/storage';

export const needsLogin = async (): Promise<Response | undefined> => {
export const needsLogin = async (): Promise<Response | null> => {
const password = await sessionExtStorage.get('passwordKey');
if (password) return;
if (password) return null;

return redirect(PopupPath.LOGIN);
};

export const needsOnboard = async () => {
const wallets = await localExtStorage.get('wallets');
if (wallets.length) return;
if (wallets.length) return null;

void chrome.runtime.openOptionsPage();
window.close();

return null;
};

0 comments on commit 26503d7

Please sign in to comment.