Skip to content

Commit

Permalink
Should close errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanger2000 committed Mar 30, 2023
1 parent 89a3007 commit e501c18
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/features/listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ connector.registerUpdateAuthStatus(
}
)

connector.registerCloseErrors = () => {
store.dispatch(gs.closeError())
}

// @ts-ignore
connector.registerSaved(() => {
store.dispatch(gs.saveFile(null))
Expand Down
1 change: 1 addition & 0 deletions src/main/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export async function setupTokens(

webContents.getAllWebContents().forEach((wc) => {
wc.send('updateAuthStatus', { accessToken, profile, stripeProfile })
wc.send('closeErrors')
})
}

Expand Down
3 changes: 3 additions & 0 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ const electronConnector = {
refreshTokens() {
ipcRenderer.invoke('refreshTokens')
},
registerCloseErrors(callback: Callback) {
ipcRenderer.on('closeErrors', callback)
}
}

contextBridge.exposeInMainWorld('connector', electronConnector)
Expand Down

0 comments on commit e501c18

Please sign in to comment.