fix: invalid network connection logic when Network API is not supported by the browser

Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
Fernando Fernández 2024-03-27 16:53:15 +01:00
parent 028b41ad01
commit ef4ff9c5bb

View File

@ -46,9 +46,9 @@ export const isFinePointer = useMediaQuery('(pointer:fine)');
*/
const network = useNetwork();
export const isConnectedToServer = computedAsync(async () => {
if ((network.isSupported.value && network.isOnline.value)) {
if (network.isSupported.value && network.isOnline.value) {
return true;
} else if (!isNil(remote.auth.currentServer) && !remote.socket.isConnected.value) {
} else if (!isNil(remote.auth.currentServer) || !remote.socket.isConnected.value) {
try {
await remote.sdk.newUserApi(getSystemApi).getPingSystem();