Change error prompts
This commit is contained in:
@@ -33,7 +33,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
if (next case AsyncData(:final value)) {
|
||||
switch (value.latestVersion) {
|
||||
case AsyncError(:final error):
|
||||
CustomToast.error(t.presentError(error)).show(context);
|
||||
CustomToast.error(t.printError(error)).show(context);
|
||||
default:
|
||||
if (value.newVersionAvailable) {
|
||||
await NewVersionDialog(
|
||||
|
||||
@@ -31,7 +31,7 @@ class ProfileTile extends HookConsumerWidget {
|
||||
|
||||
final selectActiveMutation = useMutation(
|
||||
initialOnFailure: (err) {
|
||||
CustomToast.error(t.presentError(err)).show(context);
|
||||
CustomToast.error(t.printError(err)).show(context);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -146,7 +146,8 @@ class ProfileActionButton extends HookConsumerWidget {
|
||||
|
||||
final updateProfileMutation = useMutation(
|
||||
initialOnFailure: (err) {
|
||||
CustomToast.error(t.presentError(err)).show(context);
|
||||
// CustomToast.error(t.printError(err)).show(context);
|
||||
CustomAlertDialog.fromErr(t.presentError(err)).show(context);
|
||||
},
|
||||
initialOnSuccess: () =>
|
||||
CustomToast.success(t.profile.update.successMsg).show(context),
|
||||
@@ -204,14 +205,14 @@ class ProfileActionsMenu extends HookConsumerWidget {
|
||||
|
||||
final updateProfileMutation = useMutation(
|
||||
initialOnFailure: (err) {
|
||||
CustomToast.error(t.presentError(err)).show(context);
|
||||
CustomAlertDialog.fromErr(t.presentError(err)).show(context);
|
||||
},
|
||||
initialOnSuccess: () =>
|
||||
CustomToast.success(t.profile.update.successMsg).show(context),
|
||||
);
|
||||
final deleteProfileMutation = useMutation(
|
||||
initialOnFailure: (err) {
|
||||
CustomToast.error(t.presentError(err)).show(context);
|
||||
CustomAlertDialog.fromErr(t.presentError(err)).show(context);
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class HomePage extends HookConsumerWidget {
|
||||
_ => const EmptyProfilesHomeBody(),
|
||||
},
|
||||
AsyncError(:final error) =>
|
||||
SliverErrorBodyPlaceholder(t.presentError(error)),
|
||||
SliverErrorBodyPlaceholder(t.printError(error)),
|
||||
_ => const SliverToBoxAdapter(),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -24,13 +24,12 @@ class ConnectionButton extends HookConsumerWidget {
|
||||
connectivityControllerProvider,
|
||||
(_, next) {
|
||||
if (next case AsyncError(:final error)) {
|
||||
CustomToast.error(t.presentError(error)).show(context);
|
||||
CustomAlertDialog.fromErr(t.presentError(error)).show(context);
|
||||
}
|
||||
if (next
|
||||
case AsyncData(value: Disconnected(:final connectionFailure?))) {
|
||||
CustomAlertDialog(
|
||||
message: connectionFailure.present(t),
|
||||
).show(context);
|
||||
CustomAlertDialog.fromErr(t.presentError(connectionFailure))
|
||||
.show(context);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -138,7 +138,7 @@ class LogsPage extends HookConsumerWidget with PresLogger {
|
||||
NestedTabAppBar(
|
||||
title: Text(t.logs.pageTitle.titleCase),
|
||||
),
|
||||
SliverErrorBodyPlaceholder(t.presentError(error)),
|
||||
SliverErrorBodyPlaceholder(t.printError(error)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -38,7 +38,7 @@ class ProfileDetailPage extends HookConsumerWidget with PresLogger {
|
||||
if (asyncSave case AsyncData(value: final save)) {
|
||||
switch (save) {
|
||||
case MutationFailure(:final failure):
|
||||
CustomToast.error(t.presentError(failure)).show(context);
|
||||
CustomToast.error(t.printError(failure)).show(context);
|
||||
case MutationSuccess():
|
||||
CustomToast.success(t.profile.save.successMsg.sentenceCase)
|
||||
.show(context);
|
||||
@@ -58,7 +58,7 @@ class ProfileDetailPage extends HookConsumerWidget with PresLogger {
|
||||
if (asyncSave case AsyncData(value: final delete)) {
|
||||
switch (delete) {
|
||||
case MutationFailure(:final failure):
|
||||
CustomToast.error(t.presentError(failure)).show(context);
|
||||
CustomToast.error(t.printError(failure)).show(context);
|
||||
case MutationSuccess():
|
||||
CustomToast.success(t.profile.delete.successMsg.sentenceCase)
|
||||
.show(context);
|
||||
|
||||
@@ -30,7 +30,8 @@ class AddProfileModal extends HookConsumerWidget {
|
||||
final addProfileMutation = useMutation(
|
||||
initialOnFailure: (err) {
|
||||
mutationTriggered.value = false;
|
||||
CustomToast.error(t.presentError(err)).show(context);
|
||||
// CustomToast.error(t.presentError(err)).show(context);
|
||||
CustomAlertDialog.fromErr(t.presentError(err)).show(context);
|
||||
},
|
||||
initialOnSuccess: () {
|
||||
CustomToast.success(t.profile.save.successMsg.sentenceCase)
|
||||
|
||||
@@ -38,7 +38,7 @@ class ProfilesModal extends HookConsumerWidget {
|
||||
itemCount: profiles.length,
|
||||
),
|
||||
AsyncError(:final error) => SliverErrorBodyPlaceholder(
|
||||
t.presentError(error),
|
||||
t.printError(error),
|
||||
),
|
||||
AsyncLoading() => const SliverLoadingBodyPlaceholder(),
|
||||
_ => const SliverToBoxAdapter(),
|
||||
|
||||
@@ -22,7 +22,7 @@ class ProxiesPage extends HookConsumerWidget with PresLogger {
|
||||
|
||||
final selectActiveProxyMutation = useMutation(
|
||||
initialOnFailure: (error) =>
|
||||
CustomToast.error(t.presentError(error)).show(context),
|
||||
CustomToast.error(t.printError(error)).show(context),
|
||||
);
|
||||
|
||||
switch (asyncProxies) {
|
||||
@@ -148,7 +148,7 @@ class ProxiesPage extends HookConsumerWidget with PresLogger {
|
||||
title: Text(t.proxies.pageTitle.titleCase),
|
||||
),
|
||||
SliverErrorBodyPlaceholder(
|
||||
t.presentError(error),
|
||||
t.printError(error),
|
||||
icon: null,
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user