Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: use variable before initialize (#19737)

ecmadao1101fc3d5405
diff --git a/frontend/src/components/GeneralSetting/BrandingSetting.vue b/frontend/src/components/GeneralSetting/BrandingSetting.vue
index 77a2481c3f..76e161ee71 100644
--- a/frontend/src/components/GeneralSetting/BrandingSetting.vue
+++ b/frontend/src/components/GeneralSetting/BrandingSetting.vue
@@ -131,6 +131,18 @@ const state = reactive<LocalState>({
showFeatureModal: false,
});
+const allowSave = computed((): boolean => {
+ if (!workspaceStore.currentWorkspace) {
+ return false;
+ }
+ return (
+ (state.title &&
+ state.title !== workspaceStore.currentWorkspace?.title &&
+ state.title.trim() !== "") ||
+ state.logoUrl !== workspaceStore.currentWorkspace?.logo
+ );
+});
+
// Re-sync local state when the workspace loads asynchronously,
// but only if the user hasn't made edits yet.
watchEffect(() => {
@@ -145,18 +157,6 @@ const workspaceID = computed(() => {
return name.replace(/^workspaces\//, "");
});
-const allowSave = computed((): boolean => {
- if (!workspaceStore.currentWorkspace) {
- return false;
- }
- return (
- (state.title &&
- state.title !== workspaceStore.currentWorkspace?.title &&
- state.title.trim() !== "") ||
- state.logoUrl !== workspaceStore.currentWorkspace?.logo
- );
-});
-
const hasBrandingFeature = featureToRef(PlanFeature.FEATURE_CUSTOM_LOGO);
const doUpdate = async (content: string) => {