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(
child: ExceptionWidget(
folders.error,
onRetry: () async {
await widget.bloc.refresh();
},
onRetry: widget.bloc.refresh,
),
),
Center(

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

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

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

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

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

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

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

@ -254,9 +254,7 @@ class _HomePageState extends State<HomePage> {
] else ...[
ExceptionWidget(
capabilities.error,
onRetry: () async {
await _capabilitiesBloc.refresh();
},
onRetry: _capabilitiesBloc.refresh,
),
CustomLinearProgressIndicator(
visible: capabilities.loading,
@ -303,9 +301,7 @@ class _HomePageState extends State<HomePage> {
ExceptionWidget(
appImplementations.error,
onlyIcon: isQuickBar,
onRetry: () async {
await _appsBloc.refresh();
},
onRetry: _appsBloc.refresh,
),
CustomLinearProgressIndicator(
visible: appImplementations.loading,
@ -539,9 +535,7 @@ class _HomePageState extends State<HomePage> {
children: [
ExceptionWidget(
appImplementations.error,
onRetry: () async {
await _appsBloc.refresh();
},
onRetry: _appsBloc.refresh,
),
if (appImplementations.data != null) ...[
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) {
if (a.id == account.id) {
ExceptionWidget.showSnackbar(context, AppLocalizations.of(context).errorAccountAlreadyExists);
_loginBloc.setServerURL(result.server);
await _loginBloc.refresh();
return;
}
}
@ -168,9 +168,7 @@ class _LoginPageState extends State<LoginPage> {
height: 10,
),
ElevatedButton(
onPressed: () {
_loginBloc.setServerURL(serverURLSnapshot.data!);
},
onPressed: _loginBloc.refresh,
child: Text(AppLocalizations.of(context).loginOpenAgain),
),
],
@ -224,17 +222,13 @@ class _LoginPageState extends State<LoginPage> {
if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[
ExceptionWidget(
AppLocalizations.of(context).errorUnableToReachServer,
onRetry: () {
_loginBloc.setServerURL(serverURLSnapshot.data);
},
onRetry: _loginBloc.refresh,
),
],
if (serverConnectionStateSnapshot.data == ServerConnectionState.maintenanceMode) ...[
ExceptionWidget(
AppLocalizations.of(context).errorServerInMaintenanceMode,
onRetry: () {
_loginBloc.setServerURL(serverURLSnapshot.data);
},
onRetry: _loginBloc.refresh,
),
],
],

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

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

Loading…
Cancel
Save