Maybe this shuts it up

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-07-12 09:59:31 +02:00
parent 4ef8c9fd29
commit d7811d9db7
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { EventSubscription } from 'fbemitter';
import RoomViewStore from './stores/RoomViewStore'; import RoomViewStore from './stores/RoomViewStore';
type Listener = (isActive: boolean) => void; type Listener = (isActive: boolean) => void;
@ -30,7 +31,7 @@ type Listener = (isActive: boolean) => void;
export class ActiveRoomObserver { export class ActiveRoomObserver {
private listeners: {[key: string]: Listener[]} = {}; private listeners: {[key: string]: Listener[]} = {};
private _activeRoomId = RoomViewStore.getRoomId(); private _activeRoomId = RoomViewStore.getRoomId();
private readonly roomStoreToken: string; private readonly roomStoreToken: EventSubscription;
constructor() { constructor() {
// TODO: We could self-destruct when the last listener goes away, or at least stop listening. // TODO: We could self-destruct when the last listener goes away, or at least stop listening.