Browse Source

neon: Cleanup retries

pull/146/head
jld3103 2 years ago
parent
commit
a67d2e871d
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 4
      packages/neon/lib/src/apps/news/dialogs/add_feed.dart
  2. 4
      packages/neon/lib/src/apps/notes/dialogs/create_note.dart
  3. 4
      packages/neon/lib/src/apps/notes/dialogs/select_category.dart
  4. 4
      packages/neon/lib/src/pages/account_settings.dart
  5. 12
      packages/neon/lib/src/pages/home.dart
  6. 14
      packages/neon/lib/src/pages/login.dart
  7. 4
      packages/neon/lib/src/widgets/account_tile.dart

4
packages/neon/lib/src/apps/news/dialogs/add_feed.dart

@ -68,9 +68,7 @@ class _NewsAddFeedDialogState extends State<NewsAddFeedDialog> {
Center( Center(
child: ExceptionWidget( child: ExceptionWidget(
folders.error, folders.error,
onRetry: () async { onRetry: widget.bloc.refresh,
await widget.bloc.refresh();
},
), ),
), ),
Center( Center(

4
packages/neon/lib/src/apps/notes/dialogs/create_note.dart

@ -51,9 +51,7 @@ class _NotesCreateNoteDialogState extends State<NotesCreateNoteDialog> {
Center( Center(
child: ExceptionWidget( child: ExceptionWidget(
notes.error, notes.error,
onRetry: () async { onRetry: widget.bloc.refresh,
await widget.bloc.refresh();
},
), ),
), ),
Center( Center(

4
packages/neon/lib/src/apps/notes/dialogs/select_category.dart

@ -39,9 +39,7 @@ class _NotesSelectCategoryDialogState extends State<NotesSelectCategoryDialog> {
Center( Center(
child: ExceptionWidget( child: ExceptionWidget(
notes.error, notes.error,
onRetry: () async { onRetry: widget.bloc.refresh,
await widget.bloc.refresh();
},
), ),
), ),
Center( Center(

4
packages/neon/lib/src/pages/account_settings.dart

@ -74,9 +74,7 @@ class AccountSettingsPage extends StatelessWidget {
], ],
ExceptionWidget( ExceptionWidget(
userDetails.error, userDetails.error,
onRetry: () async { onRetry: _userDetailsBloc.refresh,
await _userDetailsBloc.refresh();
},
), ),
CustomLinearProgressIndicator( CustomLinearProgressIndicator(
visible: userDetails.loading, visible: userDetails.loading,

12
packages/neon/lib/src/pages/home.dart

@ -254,9 +254,7 @@ class _HomePageState extends State<HomePage> {
] else ...[ ] else ...[
ExceptionWidget( ExceptionWidget(
capabilities.error, capabilities.error,
onRetry: () async { onRetry: _capabilitiesBloc.refresh,
await _capabilitiesBloc.refresh();
},
), ),
CustomLinearProgressIndicator( CustomLinearProgressIndicator(
visible: capabilities.loading, visible: capabilities.loading,
@ -303,9 +301,7 @@ class _HomePageState extends State<HomePage> {
ExceptionWidget( ExceptionWidget(
appImplementations.error, appImplementations.error,
onlyIcon: isQuickBar, onlyIcon: isQuickBar,
onRetry: () async { onRetry: _appsBloc.refresh,
await _appsBloc.refresh();
},
), ),
CustomLinearProgressIndicator( CustomLinearProgressIndicator(
visible: appImplementations.loading, visible: appImplementations.loading,
@ -539,9 +535,7 @@ class _HomePageState extends State<HomePage> {
children: [ children: [
ExceptionWidget( ExceptionWidget(
appImplementations.error, appImplementations.error,
onRetry: () async { onRetry: _appsBloc.refresh,
await _appsBloc.refresh();
},
), ),
if (appImplementations.data != null) ...[ if (appImplementations.data != null) ...[
if (appImplementations.data!.isEmpty) ...[ if (appImplementations.data!.isEmpty) ...[

14
packages/neon/lib/src/pages/login.dart

@ -66,7 +66,7 @@ class _LoginPageState extends State<LoginPage> {
for (final a in accountsBloc.accounts.value) { for (final a in accountsBloc.accounts.value) {
if (a.id == account.id) { if (a.id == account.id) {
ExceptionWidget.showSnackbar(context, AppLocalizations.of(context).errorAccountAlreadyExists); ExceptionWidget.showSnackbar(context, AppLocalizations.of(context).errorAccountAlreadyExists);
_loginBloc.setServerURL(result.server); await _loginBloc.refresh();
return; return;
} }
} }
@ -168,9 +168,7 @@ class _LoginPageState extends State<LoginPage> {
height: 10, height: 10,
), ),
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: _loginBloc.refresh,
_loginBloc.setServerURL(serverURLSnapshot.data!);
},
child: Text(AppLocalizations.of(context).loginOpenAgain), child: Text(AppLocalizations.of(context).loginOpenAgain),
), ),
], ],
@ -224,17 +222,13 @@ class _LoginPageState extends State<LoginPage> {
if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[ if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[
ExceptionWidget( ExceptionWidget(
AppLocalizations.of(context).errorUnableToReachServer, AppLocalizations.of(context).errorUnableToReachServer,
onRetry: () { onRetry: _loginBloc.refresh,
_loginBloc.setServerURL(serverURLSnapshot.data);
},
), ),
], ],
if (serverConnectionStateSnapshot.data == ServerConnectionState.maintenanceMode) ...[ if (serverConnectionStateSnapshot.data == ServerConnectionState.maintenanceMode) ...[
ExceptionWidget( ExceptionWidget(
AppLocalizations.of(context).errorServerInMaintenanceMode, AppLocalizations.of(context).errorServerInMaintenanceMode,
onRetry: () { onRetry: _loginBloc.refresh,
_loginBloc.setServerURL(serverURLSnapshot.data);
},
), ),
], ],
], ],

4
packages/neon/lib/src/widgets/account_tile.dart

@ -71,9 +71,7 @@ class AccountTile extends StatelessWidget {
userDetails.error!, userDetails.error!,
onlyIcon: true, onlyIcon: true,
iconSize: 24, iconSize: 24,
onRetry: () async { onRetry: userDetailsBloc.refresh,
await userDetailsBloc.refresh();
},
), ),
], ],
], ],

Loading…
Cancel
Save