chore(common): add token_refresh auth event and harden no-sync flag
This commit is contained in:
parent
3073d156b4
commit
f344d4e395
2 changed files with 6 additions and 2 deletions
|
|
@ -38,6 +38,7 @@ export type AuthEvent =
|
|||
| { event: "probable_login"; user: HoppUser } // We have previous login state, but the app is waiting for authentication
|
||||
| { event: "login"; user: HoppUser } // We are authenticated
|
||||
| { event: "logout" } // No authentication and we have no previous state
|
||||
| { event: "token_refresh"; user: HoppUser } // We have refreshed our tokens and have new ones now
|
||||
|
||||
export type GithubSignInResult =
|
||||
| { type: "success"; user: HoppUser } // The authentication was a success
|
||||
|
|
|
|||
|
|
@ -22,8 +22,11 @@ let _isRunningDispatchWithoutSyncing = true
|
|||
|
||||
export function runDispatchWithOutSyncing(func: () => void) {
|
||||
_isRunningDispatchWithoutSyncing = false
|
||||
func()
|
||||
_isRunningDispatchWithoutSyncing = true
|
||||
try {
|
||||
func()
|
||||
} finally {
|
||||
_isRunningDispatchWithoutSyncing = true
|
||||
}
|
||||
}
|
||||
|
||||
export const getSyncInitFunction = <T extends DispatchingStore<any, any>>(
|
||||
|
|
|
|||
Loading…
Reference in a new issue