Switch all-rooms toggle for spaces to non-feature settings key
This commit is contained in:
parent
0a9d3302ba
commit
776435f620
6 changed files with 13 additions and 14 deletions
|
@ -797,7 +797,6 @@
|
||||||
"You can leave the beta any time from settings or tapping on a beta badge, like the one above.": "You can leave the beta any time from settings or tapping on a beta badge, like the one above.",
|
"You can leave the beta any time from settings or tapping on a beta badge, like the one above.": "You can leave the beta any time from settings or tapping on a beta badge, like the one above.",
|
||||||
"Beta available for web, desktop and Android. Some features may be unavailable on your homeserver.": "Beta available for web, desktop and Android. Some features may be unavailable on your homeserver.",
|
"Beta available for web, desktop and Android. Some features may be unavailable on your homeserver.": "Beta available for web, desktop and Android. Some features may be unavailable on your homeserver.",
|
||||||
"Your feedback will help make spaces better. The more detail you can go into, the better.": "Your feedback will help make spaces better. The more detail you can go into, the better.",
|
"Your feedback will help make spaces better. The more detail you can go into, the better.": "Your feedback will help make spaces better. The more detail you can go into, the better.",
|
||||||
"Show all rooms in Home": "Show all rooms in Home",
|
|
||||||
"Show options to enable 'Do not disturb' mode": "Show options to enable 'Do not disturb' mode",
|
"Show options to enable 'Do not disturb' mode": "Show options to enable 'Do not disturb' mode",
|
||||||
"Send and receive voice messages": "Send and receive voice messages",
|
"Send and receive voice messages": "Send and receive voice messages",
|
||||||
"Render LaTeX maths in messages": "Render LaTeX maths in messages",
|
"Render LaTeX maths in messages": "Render LaTeX maths in messages",
|
||||||
|
@ -868,6 +867,7 @@
|
||||||
"Manually verify all remote sessions": "Manually verify all remote sessions",
|
"Manually verify all remote sessions": "Manually verify all remote sessions",
|
||||||
"IRC display name width": "IRC display name width",
|
"IRC display name width": "IRC display name width",
|
||||||
"Show chat effects (animations when receiving e.g. confetti)": "Show chat effects (animations when receiving e.g. confetti)",
|
"Show chat effects (animations when receiving e.g. confetti)": "Show chat effects (animations when receiving e.g. confetti)",
|
||||||
|
"Show all rooms in Home": "Show all rooms in Home",
|
||||||
"Collecting app version information": "Collecting app version information",
|
"Collecting app version information": "Collecting app version information",
|
||||||
"Collecting logs": "Collecting logs",
|
"Collecting logs": "Collecting logs",
|
||||||
"Uploading logs": "Uploading logs",
|
"Uploading logs": "Uploading logs",
|
||||||
|
|
|
@ -180,15 +180,10 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
||||||
"The more detail you can go into, the better."),
|
"The more detail you can go into, the better."),
|
||||||
feedbackLabel: "spaces-feedback",
|
feedbackLabel: "spaces-feedback",
|
||||||
extraSettings: [
|
extraSettings: [
|
||||||
"feature_spaces.all_rooms",
|
"Spaces.all_rooms_in_home",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"feature_spaces.all_rooms": {
|
|
||||||
displayName: _td("Show all rooms in Home"),
|
|
||||||
supportedLevels: LEVELS_FEATURE,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
"feature_dnd": {
|
"feature_dnd": {
|
||||||
isFeature: true,
|
isFeature: true,
|
||||||
displayName: _td("Show options to enable 'Do not disturb' mode"),
|
displayName: _td("Show options to enable 'Do not disturb' mode"),
|
||||||
|
@ -756,6 +751,11 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
||||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
"Spaces.all_rooms_in_home": {
|
||||||
|
displayName: _td("Show all rooms in Home"),
|
||||||
|
supportedLevels: LEVELS_FEATURE,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
[UIFeature.RoomHistorySettings]: {
|
[UIFeature.RoomHistorySettings]: {
|
||||||
supportedLevels: LEVELS_UI_FEATURE,
|
supportedLevels: LEVELS_UI_FEATURE,
|
||||||
default: true,
|
default: true,
|
||||||
|
|
|
@ -117,12 +117,12 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
private _invitedSpaces = new Set<Room>();
|
private _invitedSpaces = new Set<Room>();
|
||||||
private spaceOrderLocalEchoMap = new Map<string, string>();
|
private spaceOrderLocalEchoMap = new Map<string, string>();
|
||||||
private _restrictedJoinRuleSupport?: IRoomCapability;
|
private _restrictedJoinRuleSupport?: IRoomCapability;
|
||||||
private _allRoomsInHome: boolean = SettingsStore.getValue("feature_spaces.all_rooms");
|
private _allRoomsInHome: boolean = SettingsStore.getValue("Spaces.all_rooms_in_home");
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(defaultDispatcher, {});
|
super(defaultDispatcher, {});
|
||||||
|
|
||||||
SettingsStore.monitorSetting("feature_spaces.all_rooms", null);
|
SettingsStore.monitorSetting("Spaces.all_rooms_in_home", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get invitedSpaces(): Room[] {
|
public get invitedSpaces(): Room[] {
|
||||||
|
@ -812,8 +812,8 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
|
|
||||||
case Action.SettingUpdated: {
|
case Action.SettingUpdated: {
|
||||||
const settingUpdatedPayload = payload as SettingUpdatedPayload;
|
const settingUpdatedPayload = payload as SettingUpdatedPayload;
|
||||||
if (settingUpdatedPayload.settingName === "feature_spaces.all_rooms") {
|
if (settingUpdatedPayload.settingName === "Spaces.all_rooms_in_home") {
|
||||||
const newValue = SettingsStore.getValue("feature_spaces.all_rooms");
|
const newValue = SettingsStore.getValue("Spaces.all_rooms_in_home");
|
||||||
if (this.allRoomsInHome !== newValue) {
|
if (this.allRoomsInHome !== newValue) {
|
||||||
this._allRoomsInHome = newValue;
|
this._allRoomsInHome = newValue;
|
||||||
this.emit(UPDATE_HOME_BEHAVIOUR, this.allRoomsInHome);
|
this.emit(UPDATE_HOME_BEHAVIOUR, this.allRoomsInHome);
|
||||||
|
|
|
@ -18,4 +18,3 @@ limitations under the License.
|
||||||
// SpaceStore reads the SettingsStore which needs the localStorage values set at init time.
|
// SpaceStore reads the SettingsStore which needs the localStorage values set at init time.
|
||||||
|
|
||||||
localStorage.setItem("mx_labs_feature_feature_spaces", "true");
|
localStorage.setItem("mx_labs_feature_feature_spaces", "true");
|
||||||
localStorage.setItem("mx_labs_feature_feature_spaces.all_rooms", "true");
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ describe("SpaceStore", () => {
|
||||||
const setShowAllRooms = async (value: boolean) => {
|
const setShowAllRooms = async (value: boolean) => {
|
||||||
if (store.allRoomsInHome === value) return;
|
if (store.allRoomsInHome === value) return;
|
||||||
const emitProm = testUtils.emitPromise(store, UPDATE_HOME_BEHAVIOUR);
|
const emitProm = testUtils.emitPromise(store, UPDATE_HOME_BEHAVIOUR);
|
||||||
await SettingsStore.setValue("feature_spaces.all_rooms", null, SettingLevel.DEVICE, value);
|
await SettingsStore.setValue("Spaces.all_rooms_in_home", null, SettingLevel.DEVICE, value);
|
||||||
jest.runAllTimers(); // run async dispatch
|
jest.runAllTimers(); // run async dispatch
|
||||||
await emitProm;
|
await emitProm;
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,7 +47,7 @@ describe("SpaceWatcher", () => {
|
||||||
|
|
||||||
const setShowAllRooms = async (value: boolean) => {
|
const setShowAllRooms = async (value: boolean) => {
|
||||||
if (store.allRoomsInHome === value) return;
|
if (store.allRoomsInHome === value) return;
|
||||||
await SettingsStore.setValue("feature_spaces.all_rooms", null, SettingLevel.DEVICE, value);
|
await SettingsStore.setValue("Spaces.all_rooms_in_home", null, SettingLevel.DEVICE, value);
|
||||||
await testUtils.emitPromise(store, UPDATE_HOME_BEHAVIOUR);
|
await testUtils.emitPromise(store, UPDATE_HOME_BEHAVIOUR);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue