From da763982cebce179a800edb5685f028da73669b3 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 10 Aug 2023 11:31:53 +0530 Subject: [PATCH 1/2] Use a copy of the value instead of a reference --- src/observable/map/FilteredMap.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/observable/map/FilteredMap.ts b/src/observable/map/FilteredMap.ts index c97bc48a..fd4cc56e 100644 --- a/src/observable/map/FilteredMap.ts +++ b/src/observable/map/FilteredMap.ts @@ -47,13 +47,13 @@ export class FilteredMap extends BaseObservableMap { */ _reapplyFilter(silent = false): void { if (this._filter) { - const oldIncluded = this._included; this._included = this._included || new Map(); for (const [key, value] of this._source) { const isIncluded = this._filter(value, key); + const oldIncluded = this._included.get(key); this._included.set(key, isIncluded); if (!silent) { - const wasIncluded = oldIncluded ? oldIncluded.get(key) : true; + const wasIncluded = oldIncluded ? oldIncluded : true; this._emitForUpdate(wasIncluded, isIncluded, key, value); } } From 4b6942bb5e9c8d88715a9564fd46bdaac6651a07 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 10 Aug 2023 11:32:26 +0530 Subject: [PATCH 2/2] Export more items for the SDK --- src/lib.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lib.ts b/src/lib.ts index 9a8552c6..322f408a 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -31,6 +31,7 @@ export type {MemberChange} from "./matrix/room/members/RoomMember"; export type {Transaction} from "./matrix/storage/idb/Transaction"; export type {Room} from "./matrix/room/Room"; export type {StateEvent} from "./matrix/storage/types"; +export {MemberList} from "./matrix/room/members/MemberList.js"; export {PowerLevels} from "./matrix/room/PowerLevels.js"; // export main view & view models export {createNavigation, createRouter} from "./domain/navigation/index"; @@ -58,6 +59,10 @@ export {EncryptionEnabledTile} from "./domain/session/room/timeline/tiles/Encryp export {MissingAttachmentTile} from "./domain/session/room/timeline/tiles/MissingAttachmentTile.js"; export {SimpleTile} from "./domain/session/room/timeline/tiles/SimpleTile"; +// export right-panel view models/ views +export { MemberListViewModel } from "./domain/session/rightpanel/MemberListViewModel.js"; +export { MemberListView } from "./platform/web/ui/session/rightpanel/MemberListView.js"; + export {TimelineView} from "./platform/web/ui/session/room/TimelineView"; export {viewClassForTile} from "./platform/web/ui/session/room/common"; export type {TileViewConstructor, ViewClassForEntryFn} from "./platform/web/ui/session/room/TimelineView"; @@ -80,6 +85,7 @@ export {Navigation} from "./domain/navigation/Navigation.js"; export {ComposerViewModel} from "./domain/session/room/ComposerViewModel.js"; export {MessageComposer} from "./platform/web/ui/session/room/MessageComposer.js"; export {TemplateView} from "./platform/web/ui/general/TemplateView"; +export {LazyListView} from "./platform/web/ui/general/LazyListView"; export type {Builder} from "./platform/web/ui/general/TemplateView" export {ViewModel} from "./domain/ViewModel"; export {LoadingView} from "./platform/web/ui/general/LoadingView.js"; @@ -102,3 +108,18 @@ export { ObservableValue, RetainedObservableValue } from "./observable/value"; +export { + FilteredMap, + JoinedMap, + ApplyMap, + LogMap, + MappedMap, +} from "./observable/map"; + +export { + avatarInitials, + getIdentifierColorNumber, + getAvatarHttpUrl, +} from "./domain/avatar"; + +export { renderStaticAvatar } from "./platform/web/ui/avatar.js";