Remove opening status display when try open an opened connection

This commit is contained in:
tiny-craft
2023-07-01 02:38:23 +08:00
parent a402c6ac30
commit e1f6aed33b
3 changed files with 9 additions and 7 deletions

View File

@@ -145,7 +145,7 @@ const renderPrefix = ({ option }) => {
NIcon,
{ size: 20 },
{
default: () => h(ToggleServer, { modelValue: !!connecte }),
default: () => h(ToggleServer, { modelValue: !!connected }),
}
)
}
@@ -166,10 +166,12 @@ const onUpdateSelectedKeys = (keys, option, meta) => {
*/
const openConnection = async (name) => {
try {
openingConnection.value = true
await connectionStore.openConnection(name)
if (!connectionStore.isConnected(name)) {
openingConnection.value = true
await connectionStore.openConnection(name)
}
tabStore.upsertTab({
server: name,
server: nam,
})
} catch (e) {
message.error(e.message)