Skip to content

Commit

Permalink
update config to watch for "getInitialData" (#6360)
Browse files Browse the repository at this point in the history
  • Loading branch information
hlshen authored Sep 13, 2023
1 parent 69fbd38 commit e9959c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion firebase-vscode/src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,26 @@ export function registerConfig(broker: ExtensionBrokerImpl): Disposable {
firebaseRC.value = readRC();
firebaseConfig.value = readConfig();

effect(() => {
const notifyFirebaseConfig = () =>
broker.send("notifyFirebaseConfig", {
firebaseJson: firebaseConfig.value.data,
firebaseRC: firebaseRC.value.data,
});

broker.on("getInitialData", () => {
notifyFirebaseConfig();
});

const rcWatcher = createWatcher(".firebaserc");
rcWatcher.onDidChange(() => {
firebaseRC.value = readRC();
notifyFirebaseConfig();
});

const jsonWatcher = createWatcher("firebase.json");
jsonWatcher.onDidChange(() => {
firebaseConfig.value = readConfig();
notifyFirebaseConfig();
});

return {
Expand Down

0 comments on commit e9959c5

Please sign in to comment.