Skip to content

Commit 8ef12ed

Browse files
committed
fix: v2ex settings token 复制过来默认是不合法的需要转换
1 parent 6368c45 commit 8ef12ed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

V2exOS/Views/ProfileView.swift

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ struct ProfileView: View {
6464
HStack {
6565
TextField("Personal Access Token", text: $accessToken, prompt: Text("00000000-0000-0000-0000-000000000000"))
6666
.frame(width: 450)
67+
.onChange(of: accessToken) { newValue in
68+
// https://v2ex.com/settings/tokens 默认选中复制过来是不合法的
69+
accessToken = newValue.trimmingCharacters(in: .whitespacesAndNewlines)
70+
}
71+
6772

6873
Button {
6974
showingPopover.toggle()

0 commit comments

Comments
 (0)