Merge branch 'develop' into hs/bridge-info
This commit is contained in:
commit
0a8cc416bf
203 changed files with 5331 additions and 2496 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
Copyright 2017 Travis Ralston
|
||||
Copyright 2018, 2019 New Vector Ltd.
|
||||
Copyright 2019 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,6 +25,7 @@ import {
|
|||
import CustomStatusController from "./controllers/CustomStatusController";
|
||||
import ThemeController from './controllers/ThemeController';
|
||||
import ReloadOnChangeController from "./controllers/ReloadOnChangeController";
|
||||
import {RIGHT_PANEL_PHASES} from "../stores/RightPanelStorePhases";
|
||||
|
||||
// These are just a bunch of helper arrays to avoid copy/pasting a bunch of times
|
||||
const LEVELS_ROOM_SETTINGS = ['device', 'room-device', 'room-account', 'account', 'config'];
|
||||
|
@ -134,13 +136,6 @@ export const SETTINGS = {
|
|||
supportedLevels: ['account'],
|
||||
default: null,
|
||||
},
|
||||
"feature_dm_verification": {
|
||||
isFeature: true,
|
||||
displayName: _td("Send verification requests in direct message," +
|
||||
" including a new verification UX in the member panel."),
|
||||
supportedLevels: LEVELS_FEATURE,
|
||||
default: false,
|
||||
},
|
||||
"feature_cross_signing": {
|
||||
isFeature: true,
|
||||
displayName: _td("Enable cross-signing to verify per-user instead of per-device (in development)"),
|
||||
|
@ -469,4 +464,20 @@ export const SETTINGS = {
|
|||
displayName: _td("Show previews/thumbnails for images"),
|
||||
default: true,
|
||||
},
|
||||
"showRightPanelInRoom": {
|
||||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
||||
default: false,
|
||||
},
|
||||
"showRightPanelInGroup": {
|
||||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
||||
default: false,
|
||||
},
|
||||
"lastRightPanelPhaseForRoom": {
|
||||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
||||
default: RIGHT_PANEL_PHASES.RoomMemberInfo,
|
||||
},
|
||||
"lastRightPanelPhaseForGroup": {
|
||||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
||||
default: RIGHT_PANEL_PHASES.GroupMemberList,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
Copyright 2017 Travis Ralston
|
||||
Copyright 2019 New Vector Ltd.
|
||||
Copyright 2019 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -56,6 +57,17 @@ export default class DeviceSettingsHandler extends SettingsHandler {
|
|||
return null; // wrong type or otherwise not set
|
||||
}
|
||||
|
||||
// Special case the right panel - see `setValue` for rationale.
|
||||
if ([
|
||||
"showRightPanelInRoom",
|
||||
"showRightPanelInGroup",
|
||||
"lastRightPanelPhaseForRoom",
|
||||
"lastRightPanelPhaseForGroup",
|
||||
].includes(settingName)) {
|
||||
const val = JSON.parse(localStorage.getItem(`mx_${settingName}`) || "{}");
|
||||
return val['value'];
|
||||
}
|
||||
|
||||
const settings = this._getSettings() || {};
|
||||
return settings[settingName];
|
||||
}
|
||||
|
@ -81,6 +93,20 @@ export default class DeviceSettingsHandler extends SettingsHandler {
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
// Special case the right panel because we want to be able to update these all
|
||||
// concurrently without stomping on one another. We could use async/await, though
|
||||
// that introduces just enough latency to be annoying.
|
||||
if ([
|
||||
"showRightPanelInRoom",
|
||||
"showRightPanelInGroup",
|
||||
"lastRightPanelPhaseForRoom",
|
||||
"lastRightPanelPhaseForGroup",
|
||||
].includes(settingName)) {
|
||||
localStorage.setItem(`mx_${settingName}`, JSON.stringify({value: newValue}));
|
||||
this._watchers.notifyUpdate(settingName, null, SettingLevel.DEVICE, newValue);
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const settings = this._getSettings() || {};
|
||||
settings[settingName] = newValue;
|
||||
localStorage.setItem("mx_local_settings", JSON.stringify(settings));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue