Fix freeze on room switch (#7884)

* Fix freeze on room switch

updateServerCandidates was called on every room member event and
not throttled.

Fixes https://github.com/vector-im/element-web/issues/21127

* Move import

* Disable throttling in tests

* Types

Co-authored-by: Travis Ralston <travisr@matrix.org>

Co-authored-by: Travis Ralston <travisr@matrix.org>
This commit is contained in:
David Baker 2022-02-23 19:16:12 +00:00 committed by GitHub
parent 5c5dc69547
commit 81cda7c749
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View file

@ -122,7 +122,7 @@ describe('Permalinks', function() {
},
member95,
]);
const creator = new RoomPermalinkCreator(room);
const creator = new RoomPermalinkCreator(room, null, false);
creator.load();
expect(creator._serverCandidates[0]).toBe("pl_95");
member95.membership = "left";