[FIX] Remove servers offline from server list (#4286)

This commit is contained in:
Reinaldo Neto 2022-06-21 16:40:29 -03:00 committed by GitHub
parent a5a45f533b
commit 9985e9baf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -81,6 +81,7 @@ export async function removeServer({ server }: { server: string }): Promise<void
if (userId) { if (userId) {
const resume = UserPreferences.getString(`${TOKEN_KEY}-${userId}`); const resume = UserPreferences.getString(`${TOKEN_KEY}-${userId}`);
try {
const sdk = new RocketchatClient({ host: server, protocol: 'ddp', useSsl: isSsl(server) }); const sdk = new RocketchatClient({ host: server, protocol: 'ddp', useSsl: isSsl(server) });
await sdk.login({ resume }); await sdk.login({ resume });
@ -90,6 +91,9 @@ export async function removeServer({ server }: { server: string }): Promise<void
} }
await sdk.logout(); await sdk.logout();
} catch (e) {
log(e);
}
} }
await removeServerData({ server }); await removeServerData({ server });