mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-09-01 07:04:07 +00:00
make it possible to hide flame warning
This commit is contained in:
parent
e8e3254278
commit
0291a4c3a2
8 changed files with 53 additions and 3 deletions
|
|
@ -4273,6 +4273,18 @@ abstract class AppLocalizations {
|
|||
/// In en, this message translates to:
|
||||
/// **'All memories are up to date.'**
|
||||
String get settingsStorageSyncUpToDate;
|
||||
|
||||
/// No description provided for @restoreLostFlames.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Restore your {count} lost flames'**
|
||||
String restoreLostFlames(int count);
|
||||
|
||||
/// No description provided for @settingsShowRestoreFlameTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Show flame restore warning'**
|
||||
String get settingsShowRestoreFlameTitle;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
|
|
|||
|
|
@ -2475,4 +2475,13 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
@override
|
||||
String get settingsStorageSyncUpToDate =>
|
||||
'Alle Memories sind auf dem neuesten Stand.';
|
||||
|
||||
@override
|
||||
String restoreLostFlames(int count) {
|
||||
return 'Stelle deine $count verlorenen Flammen wieder her';
|
||||
}
|
||||
|
||||
@override
|
||||
String get settingsShowRestoreFlameTitle =>
|
||||
'Hinweis zur Flammen-Wiederherstellung anzeigen';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2453,4 +2453,12 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
|
||||
@override
|
||||
String get settingsStorageSyncUpToDate => 'All memories are up to date.';
|
||||
|
||||
@override
|
||||
String restoreLostFlames(int count) {
|
||||
return 'Restore your $count lost flames';
|
||||
}
|
||||
|
||||
@override
|
||||
String get settingsShowRestoreFlameTitle => 'Show flame restore warning';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 34c835db2de08af962b39fb79ec11341b8847926
|
||||
Subproject commit c5f554b36deab290c091ae46b3af1255f74c6b98
|
||||
|
|
@ -93,6 +93,9 @@ class UserData {
|
|||
@JsonKey(defaultValue: true)
|
||||
bool typingIndicators = true;
|
||||
|
||||
@JsonKey(defaultValue: true)
|
||||
bool showRestoreFlame = true;
|
||||
|
||||
String? myBestFriendGroupId;
|
||||
|
||||
DateTime? signalLastSignedPreKeyUpdated;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ UserData _$UserDataFromJson(Map<String, dynamic> json) =>
|
|||
..autoStoreAllSendUnlimitedMediaFiles =
|
||||
json['autoStoreAllSendUnlimitedMediaFiles'] as bool? ?? false
|
||||
..typingIndicators = json['typingIndicators'] as bool? ?? true
|
||||
..showRestoreFlame = json['showRestoreFlame'] as bool? ?? true
|
||||
..myBestFriendGroupId = json['myBestFriendGroupId'] as String?
|
||||
..signalLastSignedPreKeyUpdated =
|
||||
json['signalLastSignedPreKeyUpdated'] == null
|
||||
|
|
@ -151,6 +152,7 @@ Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{
|
|||
'autoStoreAllSendUnlimitedMediaFiles':
|
||||
instance.autoStoreAllSendUnlimitedMediaFiles,
|
||||
'typingIndicators': instance.typingIndicators,
|
||||
'showRestoreFlame': instance.showRestoreFlame,
|
||||
'myBestFriendGroupId': instance.myBestFriendGroupId,
|
||||
'signalLastSignedPreKeyUpdated': instance.signalLastSignedPreKeyUpdated
|
||||
?.toIso8601String(),
|
||||
|
|
|
|||
|
|
@ -107,6 +107,9 @@ class _RestoreFlameCompState extends State<RestoreFlameComp> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!userService.currentUser.showRestoreFlame) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
if (_group == null || !isItPossibleToRestoreFlames(_group!)) {
|
||||
return Container();
|
||||
}
|
||||
|
|
@ -115,7 +118,7 @@ class _RestoreFlameCompState extends State<RestoreFlameComp> {
|
|||
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
onTap: _restoreFlames,
|
||||
title: Text(
|
||||
'Restore your ${_group!.maxFlameCounter} lost flames',
|
||||
context.lang.restoreLostFlames(_group!.maxFlameCounter),
|
||||
style: const TextStyle(fontWeight: FontWeight.w500),
|
||||
),
|
||||
trailing: const SizedBox(
|
||||
|
|
@ -134,7 +137,7 @@ class _RestoreFlameCompState extends State<RestoreFlameComp> {
|
|||
emoji: '🔥',
|
||||
),
|
||||
),
|
||||
text: 'Restore your ${_group!.maxFlameCounter} lost flames',
|
||||
text: context.lang.restoreLostFlames(_group!.maxFlameCounter),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,12 @@ class _ChatSettingsViewState extends State<ChatSettingsView> {
|
|||
});
|
||||
}
|
||||
|
||||
Future<void> setShowRestoreFlame(bool value) async {
|
||||
await UserService.update((u) {
|
||||
u.showRestoreFlame = value;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
|
@ -55,6 +61,13 @@ class _ChatSettingsViewState extends State<ChatSettingsView> {
|
|||
.automaticallyMarkEqualMediaFilesAsOpened,
|
||||
onChanged: setAutomaticallyMarkEqualMediaFilesAsOpened,
|
||||
),
|
||||
SwitchListTile.adaptive(
|
||||
title: Text(
|
||||
context.lang.settingsShowRestoreFlameTitle,
|
||||
),
|
||||
value: userService.currentUser.showRestoreFlame,
|
||||
onChanged: setShowRestoreFlame,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue