Make trailing : into a setting (#6711)
* Make trailing `:` into a setting Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Make traling comma opt-out Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Write `insertTrailingComma` when reading for future opt-in setting Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Update src/editor/parts.ts * Fix line length Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> Co-authored-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
@@ -121,6 +121,19 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
|
||||
return content[settingName];
|
||||
}
|
||||
|
||||
if (settingName === "MessageComposerInput.insertTrailingComma") {
|
||||
const content = this.getSettings() || {};
|
||||
const value = content[settingName];
|
||||
if (value === null || value === undefined) {
|
||||
// Write true as it is the default. This will give us the option
|
||||
// of making this opt-in in the future, without affecting old
|
||||
// users
|
||||
this.setValue(settingName, roomId, true);
|
||||
return true;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
const settings = this.getSettings() || {};
|
||||
let preferredValue = settings[settingName];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user