From 267ff459f6cf91ce320aa0e6df7e69feecbef1d3 Mon Sep 17 00:00:00 2001 From: phamhieu Date: Wed, 6 Apr 2022 15:24:58 +0700 Subject: [PATCH] chore: update comment --- studio/stores/RootStore.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/studio/stores/RootStore.ts b/studio/stores/RootStore.ts index 5331f208c45..ef527fa8345 100644 --- a/studio/stores/RootStore.ts +++ b/studio/stores/RootStore.ts @@ -69,10 +69,17 @@ export class RootStore implements IRootStore { ) } + /** + * Set selected project reference + * + * This method will also trigger project detail loading when it's not available + */ setProjectRef(value?: string) { if (this.ui.selectedProject?.ref === value) return if (value) { - // fetch project detail when connectionString is not available + // fetch project detail when + // - project not found yet. projectStore is loading + // - connectionString is not available. projectStore loaded const found = this.app.projects.find((x: Project) => x.ref == value) if (!found || !found.connectionString) { this.app.projects.fetchDetail(value)