2022-06-06 14:17:51 +00:00
|
|
|
import log from './helpers/log';
|
2022-05-13 14:52:37 +00:00
|
|
|
import subscribeRoomsTmp, { roomsSubscription } from './subscriptions/rooms';
|
2022-04-28 20:37:25 +00:00
|
|
|
|
2022-05-13 14:52:37 +00:00
|
|
|
export async function subscribeRooms(): Promise<void> {
|
|
|
|
if (!roomsSubscription?.stop) {
|
2022-04-28 20:37:25 +00:00
|
|
|
try {
|
2022-05-13 14:52:37 +00:00
|
|
|
await subscribeRoomsTmp();
|
2022-04-28 20:37:25 +00:00
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-13 14:52:37 +00:00
|
|
|
export function unsubscribeRooms(): void {
|
|
|
|
if (roomsSubscription?.stop) {
|
|
|
|
roomsSubscription.stop();
|
2022-04-28 20:37:25 +00:00
|
|
|
}
|
|
|
|
}
|