Hide unsync icon for offline mode

This commit is contained in:
Neeraj Gupta 2023-09-04 16:13:19 +05:30
parent a02cfef105
commit 535109d08f

View file

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:clipboard/clipboard.dart';
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/models/code.dart';
@ -31,6 +32,7 @@ class _CodeWidgetState extends State<CodeWidget> {
final ValueNotifier<String> _nextCode = ValueNotifier<String>("");
final Logger logger = Logger("_CodeWidgetState");
bool _isInitialized = false;
late bool hasConfiguredAccount;
@override
void initState() {
@ -46,6 +48,7 @@ class _CodeWidgetState extends State<CodeWidget> {
}
}
});
hasConfiguredAccount = Configuration.instance.hasConfiguredAccount();
}
@override
@ -174,8 +177,8 @@ class _CodeWidgetState extends State<CodeWidget> {
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
widget.code.hasSynced != null &&
widget.code.hasSynced!
(widget.code.hasSynced != null &&
widget.code.hasSynced!) || !hasConfiguredAccount
? Container()
: const Icon(
Icons.sync_disabled,