Skip to content

Commit

Permalink
fix: close wallet on terms reject, increase ledger poll
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Jan 14, 2021
1 parent c6816e6 commit 9bc6100
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/hooks/use-ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export enum LedgerConnectStep {
}

const SAFE_ASSUME_REAL_DEVICE_DISCONNECT_TIME = 1000;
const POLL_LEDGER_INTERVAL = 250;
const POLL_LEDGER_INTERVAL = 750;

export function useLedger() {
const [step, setStep] = useState(LedgerConnectStep.Disconnected);
Expand Down
2 changes: 2 additions & 0 deletions app/main.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ ipcMain.handle('reload-app', () => {
mainWindow?.reload();
});

ipcMain.on('closeWallet', () => app.exit(0));

//
// TODO: refactor to be more generic
// There's a bug where click handler doesn't fire for the top-level menu
Expand Down
2 changes: 1 addition & 1 deletion app/pages/onboarding/00-terms/terms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export const Terms: React.FC = () => {
</Box>
<Flex justifyContent="center" alignItems="center" mt="extra-loose" mb="120px">
<Flex>
<OnboardingButton onClick={() => console.log('Close wallet')} mode="secondary">
<OnboardingButton onClick={() => api.closeWallet()} mode="secondary">
Close
</OnboardingButton>
<OnboardingButton onClick={() => history.push(routes.WELCOME)} ml="base">
Expand Down
2 changes: 2 additions & 0 deletions app/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const walletApi = {
contextMenu: (menuItems: any) => ipcRenderer.send('context-menu-open', { menuItems }),

installPath: () => ipcRenderer.sendSync('installPath'),

closeWallet: () => ipcRenderer.send('closeWallet'),
};

declare global {
Expand Down

0 comments on commit 9bc6100

Please sign in to comment.