Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit a8ee64a

Browse files
committed
Add "on_logging_in" to Action
Signed-off-by: Mikhail Aheichyk <[email protected]>
1 parent 1c6d1bf commit a8ee64a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/Lifecycle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ async function doSetLoggedIn(
611611
// can be disabled to resolve "Cannot dispatch in the middle of a dispatch."
612612
// error when it is invoked via another dispatch that is not yet finished.
613613
if (dispatchOnLoggingIn) {
614-
dis.dispatch({ action: "on_logging_in" }, true);
614+
dis.dispatch({ action: Action.OnLoggingIn }, true);
615615
}
616616

617617
if (clearStorageEnabled) {

src/dispatcher/actions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,11 @@ export enum Action {
326326
*/
327327
OnLoggedOut = "on_logged_out",
328328

329+
/**
330+
* Fired when the client has started to log in. No additional payload information required.
331+
*/
332+
OnLoggingIn = "on_logging_in",
333+
329334
/**
330335
* Fired when the client was logged in. No additional payload information required.
331336
*/

test/Lifecycle-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe("Lifecycle", () => {
6969
// promise to wait 'on_logging_in'
7070
const loggingInPromise = new Promise((resolve, reject) => {
7171
defaultDispatcher.register((payload: ActionPayload) => {
72-
if (payload.action === "on_logging_in") {
72+
if (payload.action === Action.OnLoggingIn) {
7373
resolve(undefined);
7474
}
7575
});

0 commit comments

Comments
 (0)