File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -720,8 +720,12 @@ export default class SettingsStore {
720
720
* Migrate the setting for visible images to a setting.
721
721
*/
722
722
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
+ }
725
729
726
730
logger . info ( "Performing one-time settings migration of show images and invite avatars to account data" ) ;
727
731
const handler = LEVEL_HANDLERS [ SettingLevel . ACCOUNT ] ;
@@ -735,8 +739,6 @@ export default class SettingsStore {
735
739
media_previews : showImages === false ? MediaPreviewValue . Off : MediaPreviewValue . On ,
736
740
} ) ;
737
741
} // else, we don't set anything and use the server value
738
-
739
- localStorage . setItem ( MIGRATION_DONE_FLAG , "true" ) ;
740
742
}
741
743
742
744
/**
You can’t perform that action at this time.
0 commit comments