[FIX] Remove servers offline from server list (#4286)
This commit is contained in:
parent
a5a45f533b
commit
9985e9baf3
|
@ -81,15 +81,19 @@ 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}`);
|
||||||
|
|
||||||
const sdk = new RocketchatClient({ host: server, protocol: 'ddp', useSsl: isSsl(server) });
|
try {
|
||||||
await sdk.login({ resume });
|
const sdk = new RocketchatClient({ host: server, protocol: 'ddp', useSsl: isSsl(server) });
|
||||||
|
await sdk.login({ resume });
|
||||||
|
|
||||||
const token = getDeviceToken();
|
const token = getDeviceToken();
|
||||||
if (token) {
|
if (token) {
|
||||||
await sdk.del('push.token', { token });
|
await sdk.del('push.token', { token });
|
||||||
|
}
|
||||||
|
|
||||||
|
await sdk.logout();
|
||||||
|
} catch (e) {
|
||||||
|
log(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
await sdk.logout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await removeServerData({ server });
|
await removeServerData({ server });
|
||||||
|
|
Loading…
Reference in New Issue