Skip to content

Commit 175d04f

Browse files
committed
fix: don't show warning when connector has closed
1 parent ddffa6c commit 175d04f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

app/components/ConnectorModal.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ const tokenInput = shallowRef('')
88
const portInput = shallowRef('31415')
99
const { copied, copy } = useClipboard({ copiedDuring: 2000 })
1010
11+
const hasAttemptedConnect = shallowRef(false)
12+
1113
async function handleConnect() {
14+
hasAttemptedConnect.value = true
1215
const port = Number.parseInt(portInput.value, 10) || 31415
1316
const success = await connect(tokenInput.value.trim(), port)
1417
if (success) {
@@ -42,6 +45,7 @@ const executeNpmxConnectorCommand = computed(() => {
4245
watch(open, isOpen => {
4346
if (isOpen) {
4447
tokenInput.value = ''
48+
hasAttemptedConnect.value = false
4549
}
4650
})
4751
</script>
@@ -242,9 +246,9 @@ watch(open, isOpen => {
242246
</details>
243247
</div>
244248

245-
<!-- Error message -->
249+
<!-- Error message (only show after user explicitly clicks Connect) -->
246250
<div
247-
v-if="error"
251+
v-if="error && hasAttemptedConnect"
248252
role="alert"
249253
class="p-3 text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-md"
250254
>

0 commit comments

Comments
 (0)