Merge pull request #6694 from SimonBrandner/task/set-new-layout

Set the new layout setting when reading it
This commit is contained in:
Travis Ralston 2021-08-27 09:08:40 -06:00 committed by GitHub
commit 5e934c17da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,7 +71,13 @@ export default class DeviceSettingsHandler extends SettingsHandler {
// Special case for old useIRCLayout setting
if (settingName === "layout") {
const settings = this.getSettings() || {};
if (settings["useIRCLayout"]) return Layout.IRC;
if (settings["useIRCLayout"]) {
// Set the new layout setting and delete the old one so that we
// can delete this block of code after some time
settings["layout"] = Layout.IRC;
delete settings["useIRCLayout"];
localStorage.setItem("mx_local_settings", JSON.stringify(settings));
}
return settings[settingName];
}