Rocket.Chat.ReactNative/app/lib/methods/subscribeRooms.ts

19 lines
386 B
TypeScript
Raw Normal View History

import log from '../../utils/log';
import subscribeRoomsTmp, { roomsSubscription } from './subscriptions/rooms';
export async function subscribeRooms(): Promise<void> {
if (!roomsSubscription?.stop) {
try {
await subscribeRoomsTmp();
} catch (e) {
log(e);
}
}
}
export function unsubscribeRooms(): void {
if (roomsSubscription?.stop) {
roomsSubscription.stop();
}
}