add auto clock synchronization setting after repeater login
Introduced a new setting for automatic clock synchronization after a successful repeater login. Added localization support for the new feature in multiple languages (Bulgarian, German, English, Spanish, French, Hungarian, Italian, Japanese, Korean, Dutch, Polish, Portuguese, Russian, Slovak, Slovenian, Swedish, Ukrainian, Chinese). Implemented storage service methods to manage the new setting. Updated the repeater settings screen to include a toggle for the new feature. Enhanced the repeater login dialog to trigger clock synchronization automatically if the setting is enabled.
This commit is contained in:
1 parent
cac6abfef1
commit
8ba4bbfbc5
40 files changed
+400
-23
No files matched your search
@@ -187,6 +187,29 @@ class _RepeaterLoginDialogState extends State<RepeaterLoginDialog> {
|
||||
await _storage.removeRepeaterPassword(widget.repeater.publicKeyHex);
|
||||
}
|
||||
|
||||
final autoClockSync = await _storage
|
||||
.getRepeaterAutoClockSyncAfterLoginEnabled(
|
||||
widget.repeater.publicKeyHex,
|
||||
);
|
||||
if (autoClockSync) {
|
||||
try {
|
||||
final timestampSeconds =
|
||||
DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||
await _connector.sendFrame(
|
||||
buildSendCliCommandFrame(
|
||||
repeater.publicKey,
|
||||
'clock sync',
|
||||
timestampSeconds: timestampSeconds,
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
appLogger.warn(
|
||||
'Auto clock sync failed for ${repeater.name}: $e',
|
||||
tag: 'RepeaterLogin',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
Navigator.pop(context, password);
|
||||
Future.microtask(() => widget.onLogin(password));
|
||||
|
||||
Reference in new issue
Block a user