[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) {
|
||||
const resume = UserPreferences.getString(`${TOKEN_KEY}-${userId}`);
|
||||
|
||||
const sdk = new RocketchatClient({ host: server, protocol: 'ddp', useSsl: isSsl(server) });
|
||||
await sdk.login({ resume });
|
||||
try {
|
||||
const sdk = new RocketchatClient({ host: server, protocol: 'ddp', useSsl: isSsl(server) });
|
||||
await sdk.login({ resume });
|
||||
|
||||
const token = getDeviceToken();
|
||||
if (token) {
|
||||
await sdk.del('push.token', { token });
|
||||
const token = getDeviceToken();
|
||||
if (token) {
|
||||
await sdk.del('push.token', { token });
|
||||
}
|
||||
|
||||
await sdk.logout();
|
||||
} catch (e) {
|
||||
log(e);
|
||||
}
|
||||
|
||||
await sdk.logout();
|
||||
}
|
||||
|
||||
await removeServerData({ server });
|
||||
|
|
Loading…
Reference in New Issue