File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ const tokenInput = shallowRef('')
88const portInput = shallowRef (' 31415' )
99const { copied, copy } = useClipboard ({ copiedDuring: 2000 })
1010
11+ const hasAttemptedConnect = shallowRef (false )
12+
1113async 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(() => {
4245watch (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 >
You can’t perform that action at this time.
0 commit comments