Archived
Merge pull request 'Fix disconnecting state issue' (#18) from fix-disconnecting into main
Reviewed-on: https://git.internal.vyntehome.com/vynte/vynte-connect/pulls/18
This commit was merged in pull request #18.
This commit is contained in:
+3
-1
@@ -127,7 +127,9 @@ async function refreshStatus() {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return setStatus(normalizeStatus(result.stdout, cachedStatus));
|
const status = normalizeStatus(result.stdout, cachedStatus);
|
||||||
|
if (status.state === "disconnected" && cachedStatus.state === "connecting") return;
|
||||||
|
setStatus(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function connect() {
|
async function connect() {
|
||||||
|
|||||||
+1
-2
@@ -68,11 +68,10 @@ function setStatus(status: UIStatus): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
orb.addEventListener('click', async () => {
|
orb.addEventListener('click', async () => {
|
||||||
if (currentStatus.state === 'connected') {
|
if (['connected', 'connecting'].includes(currentStatus.state ?? '')) {
|
||||||
await window.vynte.disconnect();
|
await window.vynte.disconnect();
|
||||||
} else if (
|
} else if (
|
||||||
![
|
![
|
||||||
'connecting',
|
|
||||||
'disconnecting',
|
'disconnecting',
|
||||||
'loggingOut',
|
'loggingOut',
|
||||||
'checking',
|
'checking',
|
||||||
|
|||||||
Reference in New Issue
Block a user