chore: Make webRTC opt-in
This commit is contained in:
parent
c0244c66ab
commit
74100bd777
7 changed files with 30 additions and 16 deletions
|
|
@ -431,7 +431,11 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
createVoipPlugin();
|
||||
}
|
||||
|
||||
void createVoipPlugin() {
|
||||
void createVoipPlugin() async {
|
||||
if (await store.getItemBool(SettingKeys.experimentalVoip) == false) {
|
||||
voipPlugin = null;
|
||||
return;
|
||||
}
|
||||
voipPlugin =
|
||||
webrtcIsSupported ? VoipPlugin(client: client, context: context) : null;
|
||||
}
|
||||
|
|
@ -482,6 +486,9 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
store
|
||||
.getItemBool(SettingKeys.sendOnEnter, AppConfig.sendOnEnter)
|
||||
.then((value) => AppConfig.sendOnEnter = value);
|
||||
store
|
||||
.getItemBool(SettingKeys.experimentalVoip, AppConfig.experimentalVoip)
|
||||
.then((value) => AppConfig.experimentalVoip = value);
|
||||
store.getItem(SettingKeys.chatColor).then((value) {
|
||||
if (value != null && int.tryParse(value) != null) {
|
||||
AppConfig.chatColor = Color(int.parse(value));
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ class _SettingsSwitchListTileState extends State<SettingsSwitchListTile> {
|
|||
title: Text(widget.title),
|
||||
onChanged: (bool newValue) async {
|
||||
widget.onChanged?.call(newValue);
|
||||
await Matrix.of(context)
|
||||
.store
|
||||
.setItem(widget.storeKey, newValue.toString());
|
||||
await Matrix.of(context).store.setItemBool(widget.storeKey, newValue);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue