From ea77e9a5f8852a92ec0c75974d42880d6e08a576 Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Mon, 22 Dec 2025 13:29:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=8B=B9=E6=9E=9Cbug=20=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=94=AE=E7=9B=98=E9=A2=9C=E8=89=B2=E6=94=B9?= =?UTF-8?q?=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CustomKeyboard/View/KBKeyBoardMainView.m | 6 ++++-- Shared/Localization/en.lproj/Localizable.strings | 1 + Shared/Localization/zh-Hans.lproj/Localizable.strings | 1 + keyBoard/Class/Manager/AppleSignInManager.m | 11 ++++++++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CustomKeyboard/View/KBKeyBoardMainView.m b/CustomKeyboard/View/KBKeyBoardMainView.m index 387fe33..e5bb958 100644 --- a/CustomKeyboard/View/KBKeyBoardMainView.m +++ b/CustomKeyboard/View/KBKeyBoardMainView.m @@ -25,7 +25,8 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - self.backgroundColor = [KBSkinManager shared].current.keyboardBackground; +// self.backgroundColor = [KBSkinManager shared].current.keyboardBackground; + self.backgroundColor = [UIColor colorWithHex:0xD1D3DB]; // 顶部栏 self.topBar = [[KBToolBar alloc] init]; @@ -205,7 +206,8 @@ - (void)kb_applyTheme { KBSkinManager *mgr = [KBSkinManager shared]; BOOL hasImg = ([mgr currentBackgroundImage] != nil); - UIColor *bg = mgr.current.keyboardBackground; +// UIColor *bg = mgr.current.keyboardBackground; + UIColor *bg = [UIColor colorWithHex:0xD1D3DB]; self.backgroundColor = hasImg ? [UIColor clearColor] : bg; self.keyboardView.backgroundColor = hasImg ? [UIColor clearColor] : bg; if ([self.topBar respondsToSelector:@selector(kb_applyTheme)]) { diff --git a/Shared/Localization/en.lproj/Localizable.strings b/Shared/Localization/en.lproj/Localizable.strings index c637836..2055264 100644 --- a/Shared/Localization/en.lproj/Localizable.strings +++ b/Shared/Localization/en.lproj/Localizable.strings @@ -31,6 +31,7 @@ "Invalid login credential" = "Invalid login credential"; "No token returned" = "No token returned"; "Failed to save login state" = "Failed to save login state"; +"登录已取消" = "Sign-in canceled"; "请切换到主App完成登录" = "Please switch to the main app to finish signing in"; "Continue Via Email" = "Continue Via Email"; "Login With Email Password" = "Login With Email Password"; diff --git a/Shared/Localization/zh-Hans.lproj/Localizable.strings b/Shared/Localization/zh-Hans.lproj/Localizable.strings index bc036a5..57aca51 100644 --- a/Shared/Localization/zh-Hans.lproj/Localizable.strings +++ b/Shared/Localization/zh-Hans.lproj/Localizable.strings @@ -31,6 +31,7 @@ "Invalid login credential" = "无效的登录凭证"; "No token returned" = "未返回 token"; "Failed to save login state" = "保存登录态失败"; +"登录已取消" = "登录已取消"; "请切换到主App完成登录" = "请切换到主App完成登录"; "Continue Via Email" = "通过邮箱登录"; "Login With Email Password" = "使用邮箱密码登录"; diff --git a/keyBoard/Class/Manager/AppleSignInManager.m b/keyBoard/Class/Manager/AppleSignInManager.m index 197e6fa..34856e5 100644 --- a/keyBoard/Class/Manager/AppleSignInManager.m +++ b/keyBoard/Class/Manager/AppleSignInManager.m @@ -106,7 +106,16 @@ static NSString * const kKBAppleUserIdentifierKey = @"com.company.keyboard.apple - (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithError:(NSError *)error API_AVAILABLE(ios(13.0)) { if (self.completion) { - self.completion(nil, error); + NSError *finalError = error; + if (@available(iOS 13.0, *)) { + if ([error.domain isEqualToString:ASAuthorizationErrorDomain] && error.code == ASAuthorizationErrorCanceled) { + finalError = [NSError errorWithDomain:error.domain + code:error.code + userInfo:@{NSLocalizedDescriptionKey: KBLocalized(@"登录已取消") + }]; + } + } +// self.completion(nil, finalError); } self.completion = nil; self.presentingVC = nil;