From aab07e272762cb568bcae3540b114302325a6307 Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Tue, 10 Dec 2024 06:12:10 +0900 Subject: [PATCH] feat: add message for signin required exception --- lib/view/widget/error_message.dart | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/view/widget/error_message.dart b/lib/view/widget/error_message.dart index 4d490f1a..cf9bd090 100644 --- a/lib/view/widget/error_message.dart +++ b/lib/view/widget/error_message.dart @@ -52,18 +52,21 @@ class ErrorMessage extends HookConsumerWidget { 'NO_SUCH_ROLE' => [t.misskey.noRole], 'NAME_ALREADY_EXISTS' => [t.misskey.pages_.nameAlreadyExists], 'NO_SUCH_USER' || 'USER_NOT_FOUND' => [t.misskey.noSuchUser], - _ => error.code.startsWith('TOO_MANY') - ? [ - t.misskey.youCannotCreateAnymore, - error.message, - error.id, - ] - : [ - error.code, - error.message, - if (error.info != null) - const JsonEncoder.withIndent(' ').convert(error.info), - ] + 'CREDENTIAL_REQUIRED' => [t.misskey.signinRequired], + 'SIGNIN_REQUIRED' => [ + t.misskey.thisContentsAreMarkedAsSigninRequiredByAuthor, + ], + _ when error.code.startsWith('TOO_MANY') => [ + t.misskey.youCannotCreateAnymore, + error.message, + error.id, + ], + _ => [ + error.code, + error.message, + if (error.info case final info?) + const JsonEncoder.withIndent(' ').convert(info), + ] } .join('\n'), DioException(:final type, :final response, :final error) => [