π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix(auth): don't make app unusable on error
Prateek Sunal62441b86bdb5
diff --git a/auth/lib/ui/code_widget.dart b/auth/lib/ui/code_widget.dartindex e74091758d..68b4168553 100644--- a/auth/lib/ui/code_widget.dart+++ b/auth/lib/ui/code_widget.dart@@ -28,12 +28,10 @@ import 'package:move_to_background/move_to_background.dart';class CodeWidget extends StatefulWidget {final Code code;- final bool hasError;const CodeWidget(this.code, {super.key,- this.hasError = false,});@override@@ -92,11 +90,7 @@ class _CodeWidgetState extends State<CodeWidget> {_isInitialized = true;}final l10n = context.l10n;- return IgnorePointer(- ignoring: widget.hasError,- child: Opacity(- opacity: widget.hasError ? 0.5 : 1.0,- child: Container(+ return Container(margin: const EdgeInsets.only(left: 16, right: 16, bottom: 8, top: 8),child: Builder(builder: (context) {@@ -230,8 +224,8 @@ class _CodeWidgetState extends State<CodeWidget> {);},),- ),- ),++);}diff --git a/auth/lib/ui/home_page.dart b/auth/lib/ui/home_page.dartindex 1e46890f41..18446acf4c 100644--- a/auth/lib/ui/home_page.dart+++ b/auth/lib/ui/home_page.dart@@ -253,32 +253,30 @@ class _HomePageState extends State<HomePage> {),centerTitle: true,actions: <Widget>[- if (_allCodes?.state == AllCodesState.value)- IconButton(- icon: _showSearchBox- ? const Icon(Icons.clear)- : const Icon(Icons.search),- tooltip: l10n.search,- onPressed: () {- setState(- () {- _showSearchBox = !_showSearchBox;- if (!_showSearchBox) {- _textController.clear();- _searchText = "";- } else {- _searchText = _textController.text;- }- _applyFilteringAndRefresh();- },- );- },- ),+ IconButton(+ icon: _showSearchBox+ ? const Icon(Icons.clear)+ : const Icon(Icons.search),+ tooltip: l10n.search,+ onPressed: () {+ setState(+ () {+ _showSearchBox = !_showSearchBox;+ if (!_showSearchBox) {+ _textController.clear();+ _searchText = "";+ } else {+ _searchText = _textController.text;+ }+ _applyFilteringAndRefresh();+ },+ );+ },+ ),],),floatingActionButton: !_hasLoaded ||(_allCodes?.codes.isEmpty ?? true) ||- _allCodes?.state == AllCodesState.error ||!PreferenceService.instance.hasShownCoachMark()? null: _getFab(),@@ -361,7 +359,6 @@ class _HomePageState extends State<HomePage> {return ClipRect(child: CodeWidget(_filteredCodes[newIndex],- hasError: _allCodes?.state == AllCodesState.error,),);}),