Skip to content

Commit

Permalink
perf: check cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Aug 20, 2024
1 parent 439662e commit 9e0c811
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "确认")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9e0c811

Please sign in to comment.