Skip to content

Commit 49c25c8

Browse files
authored
set current user without waiting for webview load (#8399)
* Call login before webview render * Add changelog
1 parent 2e1b45a commit 49c25c8

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

firebase-vscode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## NEXT
22

3+
- [Fixed] User auth will now load without requiring extension sidebar to open
4+
35
## 1.0.0
46

57
- [Breaking] Updated minimum VSCode version requirement to 1.69.0 to ensure node 20 is used

firebase-vscode/src/core/user.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,20 @@ export function registerUser(
4343
},
4444
);
4545

46+
const getInitialData = async () => {
47+
isLoadingUser.value = true;
48+
currentUser.value = await checkLogin();
49+
isLoadingUser.value = false;
50+
};
51+
52+
getInitialData();
53+
4654
const notifyUserChangedSub = effect(() => {
4755
broker.send("notifyUserChanged", { user: currentUser.value });
4856
});
4957

5058
const getInitialDataSub = broker.on("getInitialData", async () => {
51-
isLoadingUser.value = true;
52-
currentUser.value = await checkLogin();
53-
isLoadingUser.value = false;
59+
await getInitialData();
5460
});
5561

5662
const isLoadingSub = effect(() => {

0 commit comments

Comments
 (0)