small tweaks, still not working reliably

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-02-19 14:39:36 +00:00
parent 4278d44059
commit d70a9bd001
2 changed files with 11 additions and 1 deletions

View File

@ -437,7 +437,7 @@ export const SETTINGS = {
"RoomList.orderingAlgorithm": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Order rooms by message activity instead of by name"),
default: "recent", // XXX controller maps boolean onto algorithm for future flexibility
default: "recent", // controller maps boolean onto algorithm for future flexibility to >2 algorithms
controller: new RoomListOrderingController(),
},
"RoomList.orderByImportance": {

View File

@ -22,4 +22,14 @@ export default class RoomListOrderingController extends SettingController {
// where we may want >2 algorithms available for the user to choose between.
return newValue ? "recent" : "alphabetic";
}
getValueOverride(level: string, roomId: String, calculatedValue: *, calculatedAtLevel: string): * {
switch (calculatedValue) {
case "alphabetic":
return false;
case "recent":
default:
return true;
}
}
}