diff --git a/app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt b/app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt index 0b0f29f2c..54d2fd9e0 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt @@ -273,7 +273,7 @@ fun AdvancedPage() { confirmButton = { TextButton(onClick = { showEditCookieDlg = false - privacyStoreFlow.update { it.copy(githubCookie = value) } + privacyStoreFlow.update { it.copy(githubCookie = value.trim()) } }) { Text(text = "确认") } diff --git a/app/src/main/kotlin/li/songe/gkd/ui/component/UploadOptions.kt b/app/src/main/kotlin/li/songe/gkd/ui/component/UploadOptions.kt index 5f397f066..962249cbc 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/component/UploadOptions.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/component/UploadOptions.kt @@ -49,7 +49,7 @@ class UploadOptions( fun startTask(file: File, onSuccessResult: ((GithubPoliciesAsset) -> Unit)? = null) { val cookie = privacyStoreFlow.value.githubCookie - if (cookie == null) { + if (cookie == null || cookie.isBlank()) { toast("请先设置 cookie 后再上传") return }