Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix issue that caused the value of certain settings to be inverted #6896

Merged
merged 4 commits into from
Oct 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/settings/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ export default class SettingsStore {

const watcherId = `${new Date().getTime()}_${SettingsStore.watcherCount++}_${settingName}_${roomId}`;

const localizedCallback = (changedInRoomId, atLevel, newValAtLevel) => {
const localizedCallback = (changedInRoomId: string | null, atLevel: SettingLevel, newValAtLevel: any) => {
const newValue = SettingsStore.getValue(originalSettingName);
callbackFn(originalSettingName, changedInRoomId, atLevel, newValAtLevel, newValue);
const newValueAtLevel = SettingsStore.getValueAt(atLevel, originalSettingName) ?? newValAtLevel;
callbackFn(originalSettingName, changedInRoomId, atLevel, newValueAtLevel, newValue);
};

SettingsStore.watchers.set(watcherId, localizedCallback);
Expand Down