diff --git a/lib/models/remoteserver.dart b/lib/models/remoteserver.dart index 9f2491c4..412c0bf4 100644 --- a/lib/models/remoteserver.dart +++ b/lib/models/remoteserver.dart @@ -52,7 +52,8 @@ class RemoteServerInfoState extends ChangeNotifier { void updateSyncProgressFor(DateTime point) { var range = lastPreSyncMessagTime.toUtc().difference(DateTime.now().toUtc()); var pointFromStart = lastPreSyncMessagTime.toUtc().difference(point.toUtc()); - if (!pointFromStart.isNegative) { // ! is Negative cus all the duration's we're calculating incidently are negative + if (!pointFromStart.isNegative) { + // ! is Negative cus all the duration's we're calculating incidently are negative // this message is from before we think we should be syncing with the server // Can be because of a new server or a full resync, either way, use this (oldest message) as our lastPreSyncMessageTime this.lastPreSyncMessagTime = point; diff --git a/lib/settings.dart b/lib/settings.dart index 4ca0d341..96aff320 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -85,6 +85,13 @@ class Settings extends ChangeNotifier { return this.experiments[experiment]! == true; } } + + // If message formatting has not explicitly been turned off, then + // turn it on by default. + if (experiment == FormattingExperiment) { + return true; + } + return false; } diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index 352d11a2..25b2e4d4 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -222,6 +222,22 @@ class _GlobalSettingsViewState extends State { inactiveTrackColor: settings.theme.defaultButtonDisabledColor, secondary: Icon(CwtchIcons.streamer_bunnymask, color: settings.current().mainTextColor), ), + SwitchListTile( + title: Text(AppLocalizations.of(context)!.formattingExperiment, style: TextStyle(color: settings.current().mainTextColor)), + subtitle: Text(AppLocalizations.of(context)!.messageFormattingDescription), + value: settings.isExperimentEnabled(FormattingExperiment), + onChanged: (bool value) { + if (value) { + settings.enableExperiment(FormattingExperiment); + } else { + settings.disableExperiment(FormattingExperiment); + } + saveSettings(context); + }, + activeTrackColor: settings.theme.defaultButtonActiveColor, + inactiveTrackColor: settings.theme.defaultButtonDisabledColor, + secondary: Icon(Icons.text_fields, color: settings.current().mainTextColor), + ), SizedBox( height: 40, ), @@ -444,24 +460,6 @@ class _GlobalSettingsViewState extends State { inactiveTrackColor: settings.theme.defaultButtonDisabledColor, secondary: Icon(Icons.link, color: settings.current().mainTextColor), )), - Visibility( - visible: settings.experimentsEnabled, - child: SwitchListTile( - title: Text(AppLocalizations.of(context)!.formattingExperiment, style: TextStyle(color: settings.current().mainTextColor)), - subtitle: Text(AppLocalizations.of(context)!.messageFormattingDescription), - value: settings.isExperimentEnabled(FormattingExperiment), - onChanged: (bool value) { - if (value) { - settings.enableExperiment(FormattingExperiment); - } else { - settings.disableExperiment(FormattingExperiment); - } - saveSettings(context); - }, - activeTrackColor: settings.theme.defaultButtonActiveColor, - inactiveTrackColor: settings.theme.defaultButtonDisabledColor, - secondary: Icon(Icons.text_fields, color: settings.current().mainTextColor), - )), AboutListTile( icon: appIcon, applicationIcon: Padding(padding: EdgeInsets.all(5), child: Icon(CwtchIcons.cwtch_knott)),