make the lifetimes of the RM configurable

This commit is contained in:
Matthew Hodgson 2019-09-17 17:34:30 +01:00
parent b1618056c0
commit 832123524d
4 changed files with 47 additions and 6 deletions

View file

@ -69,7 +69,12 @@ export default class PreferencesUserSettingsTab extends React.Component {
alwaysShowMenuBarSupported: false,
minimizeToTray: true,
minimizeToTraySupported: false,
autocompleteDelay: SettingsStore.getValueAt(SettingLevel.DEVICE, 'autocompleteDelay').toString(10),
autocompleteDelay:
SettingsStore.getValueAt(SettingLevel.DEVICE, 'autocompleteDelay').toString(10),
readMarkerInViewThresholdMs:
SettingsStore.getValueAt(SettingLevel.DEVICE, 'readMarkerInViewThresholdMs').toString(10),
readMarkerOutOfViewThresholdMs:
SettingsStore.getValueAt(SettingLevel.DEVICE, 'readMarkerOutOfViewThresholdMs').toString(10),
};
}
@ -124,6 +129,16 @@ export default class PreferencesUserSettingsTab extends React.Component {
SettingsStore.setValue("autocompleteDelay", null, SettingLevel.DEVICE, e.target.value);
};
_onReadMarkerInViewThresholdMs = (e) => {
this.setState({readMarkerInViewThresholdMs: e.target.value});
SettingsStore.setValue("readMarkerInViewThresholdMs", null, SettingLevel.DEVICE, e.target.value);
};
_onReadMarkerOutOfViewThresholdMs = (e) => {
this.setState({readMarkerOutOfViewThresholdMs: e.target.value});
SettingsStore.setValue("readMarkerOutOfViewThresholdMs", null, SettingLevel.DEVICE, e.target.value);
};
_renderGroup(settingIds) {
const SettingsFlag = sdk.getComponent("views.elements.SettingsFlag");
return settingIds.map(i => <SettingsFlag key={i} name={i} level={SettingLevel.ACCOUNT} />);
@ -178,6 +193,18 @@ export default class PreferencesUserSettingsTab extends React.Component {
type='number'
value={this.state.autocompleteDelay}
onChange={this._onAutocompleteDelayChange} />
<Field
id={"readMarkerInViewThresholdMs"}
label={_t('Read Marker lifetime (ms)')}
type='number'
value={this.state.readMarkerInViewThresholdMs}
onChange={this._onReadMarkerInViewThresholdMs} />
<Field
id={"readMarkerOutOfViewThresholdMs"}
label={_t('Read Marker off-screen lifetime (ms)')}
type='number'
value={this.state.readMarkerOutOfViewThresholdMs}
onChange={this._onReadMarkerOutOfViewThresholdMs} />
</div>
</div>
);