Remove dead & duplicated code (#11405)

* Remove dead code

* Make dead code happier

* DRY pickle additional data calculation

* Iterate
This commit is contained in:
Michael Telatynski
2023-08-15 08:43:15 +00:00
committed by GitHub
parent 672ad98ec7
commit 27d79458da
25 changed files with 50 additions and 201 deletions
+1 -2
View File
@@ -577,10 +577,9 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> implements
* @param {IFilterCondition} filter The filter condition to add.
*/
public async addFilter(filter: IFilterCondition): Promise<void> {
let promise = Promise.resolve();
filter.on(FILTER_CHANGED, this.onPrefilterUpdated);
this.prefilterConditions.push(filter);
promise = this.recalculatePrefiltering();
const promise = this.recalculatePrefiltering();
promise.then(() => this.updateFn.trigger());
}
@@ -399,6 +399,4 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
}
protected async onAction(payload: ActionPayload): Promise<void> {}
protected async onDispatchAsync(payload: ActionPayload): Promise<void> {}
}
@@ -90,10 +90,6 @@ export class Algorithm extends EventEmitter {
return this._stickyRoom ? this._stickyRoom.room : null;
}
public get knownRooms(): Room[] {
return this.rooms;
}
public get hasTagSortingMap(): boolean {
return !!this.sortAlgorithms;
}
-4
View File
@@ -242,10 +242,6 @@ export class StopGapWidget extends EventEmitter {
return parsed.toString().replace(/%24/g, "$");
}
public get isManagedByManager(): boolean {
return !!this.scalarToken;
}
public get started(): boolean {
return !!this.messaging;
}
+1 -1
View File
@@ -245,7 +245,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
if (!client || !roomId) throw new Error("Not in a room or not attached to a client");
let r: { event_id: string } | null = null; // eslint-disable-line camelcase
let r: { event_id: string } | null;
if (stateKey !== null) {
// state event
r = await client.sendStateEvent(roomId, eventType, content, stateKey);