Merge pull request 'Turn on Message Formatting by Default' (#488) from default_message_formatting into trunk
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Reviewed-on: #488
This commit is contained in:
commit
0c426a129a
|
@ -52,7 +52,8 @@ class RemoteServerInfoState extends ChangeNotifier {
|
||||||
void updateSyncProgressFor(DateTime point) {
|
void updateSyncProgressFor(DateTime point) {
|
||||||
var range = lastPreSyncMessagTime.toUtc().difference(DateTime.now().toUtc());
|
var range = lastPreSyncMessagTime.toUtc().difference(DateTime.now().toUtc());
|
||||||
var pointFromStart = lastPreSyncMessagTime.toUtc().difference(point.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
|
// 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
|
// Can be because of a new server or a full resync, either way, use this (oldest message) as our lastPreSyncMessageTime
|
||||||
this.lastPreSyncMessagTime = point;
|
this.lastPreSyncMessagTime = point;
|
||||||
|
|
|
@ -85,6 +85,13 @@ class Settings extends ChangeNotifier {
|
||||||
return this.experiments[experiment]! == true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,6 +222,22 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
|
||||||
inactiveTrackColor: settings.theme.defaultButtonDisabledColor,
|
inactiveTrackColor: settings.theme.defaultButtonDisabledColor,
|
||||||
secondary: Icon(CwtchIcons.streamer_bunnymask, color: settings.current().mainTextColor),
|
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(
|
SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
),
|
),
|
||||||
|
@ -444,24 +460,6 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
|
||||||
inactiveTrackColor: settings.theme.defaultButtonDisabledColor,
|
inactiveTrackColor: settings.theme.defaultButtonDisabledColor,
|
||||||
secondary: Icon(Icons.link, color: settings.current().mainTextColor),
|
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(
|
AboutListTile(
|
||||||
icon: appIcon,
|
icon: appIcon,
|
||||||
applicationIcon: Padding(padding: EdgeInsets.all(5), child: Icon(CwtchIcons.cwtch_knott)),
|
applicationIcon: Padding(padding: EdgeInsets.all(5), child: Icon(CwtchIcons.cwtch_knott)),
|
||||||
|
|
Loading…
Reference in New Issue