Skip to content

Commit 2692d07

Browse files
committed
Stop migrationg to MSC4278 if the config exists.
1 parent 08acbf9 commit 2692d07

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/settings/SettingsStore.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,12 @@ export default class SettingsStore {
720720
* Migrate the setting for visible images to a setting.
721721
*/
722722
private static migrateMediaControlsToSetting(): void {
723-
const MIGRATION_DONE_FLAG = "mx_migrate_media_controls";
724-
if (localStorage.getItem(MIGRATION_DONE_FLAG)) return;
723+
// Never migrate if the config already exists.
724+
const existingConfig = MatrixClientPeg.get()?.getAccountData("io.element.msc4278.media_preview_config");
725+
726+
if (existingConfig) {
727+
return;
728+
}
725729

726730
logger.info("Performing one-time settings migration of show images and invite avatars to account data");
727731
const handler = LEVEL_HANDLERS[SettingLevel.ACCOUNT];
@@ -735,8 +739,6 @@ export default class SettingsStore {
735739
media_previews: showImages === false ? MediaPreviewValue.Off : MediaPreviewValue.On,
736740
});
737741
} // else, we don't set anything and use the server value
738-
739-
localStorage.setItem(MIGRATION_DONE_FLAG, "true");
740742
}
741743

742744
/**

0 commit comments

Comments
 (0)