Skip to content

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

fix: unsaved sql can not share the sheet (#736)

Yunwei Xiaoe8bb75c3fd98
diff --git a/frontend/src/views/SqlEditor/EditorPanel/EditorAction.vue b/frontend/src/views/SqlEditor/EditorPanel/EditorAction.vue
index 07c4e7e5b1..c814a5cfba 100644
--- a/frontend/src/views/SqlEditor/EditorPanel/EditorAction.vue
+++ b/frontend/src/views/SqlEditor/EditorPanel/EditorAction.vue
@@ -76,7 +76,9 @@
>
<template #trigger>
<NButton
- :disabled="isEmptyStatement || isDisconnected"
+ :disabled="
+ isEmptyStatement || isDisconnected || !currentTab.isSaved
+ "
@click="isShowSharePopover = !isShowSharePopover"
>
<carbon:share class="h-5 w-5" /> &nbsp; {{ $t("common.share") }}
diff --git a/frontend/src/views/SqlEditor/EditorPanel/SharePopover.vue b/frontend/src/views/SqlEditor/EditorPanel/SharePopover.vue
index f12c6ab4b2..275a9ab7d0 100644
--- a/frontend/src/views/SqlEditor/EditorPanel/SharePopover.vue
+++ b/frontend/src/views/SqlEditor/EditorPanel/SharePopover.vue
@@ -65,6 +65,7 @@
<NButton
class="w-20"
:type="copied ? 'success' : 'primary'"
+ :disabled="!currentTab.isSaved"
@click="handleCopy"
>
<heroicons-solid:check v-if="copied" class="h-4 w-4" />