From 343ce3b5027b2f439f74e29f3177e335f5cd0773 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 1 Apr 2021 00:02:05 -0600 Subject: [PATCH] Make log spam more quiet --- src/stores/room-list/algorithms/Algorithm.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index 1d7000bfd2..83ee803115 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -516,7 +516,12 @@ export class Algorithm extends EventEmitter { if (isNullOrUndefined(rooms)) throw new Error(`Array of rooms cannot be null`); if (!this.sortAlgorithms) throw new Error(`Cannot set known rooms without a tag sorting map`); - console.warn("Resetting known rooms, initiating regeneration"); + if (!this.updatesInhibited) { + // We only log this if we're expecting to be publishing updates, which means that + // this could be an unexpected invocation. If we're inhibited, then this is probably + // an intentional invocation. + console.warn("Resetting known rooms, initiating regeneration"); + } // Before we go any further we need to clear (but remember) the sticky room to // avoid accidentally duplicating it in the list.