From 8ef12ed4a0b7cb41842857ab518c4191166284da Mon Sep 17 00:00:00 2001 From: paranoidjk Date: Sat, 30 Nov 2024 14:20:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20v2ex=20settings=20token=20=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E8=BF=87=E6=9D=A5=E9=BB=98=E8=AE=A4=E6=98=AF=E4=B8=8D?= =?UTF-8?q?=E5=90=88=E6=B3=95=E7=9A=84=E9=9C=80=E8=A6=81=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2exOS/Views/ProfileView.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/V2exOS/Views/ProfileView.swift b/V2exOS/Views/ProfileView.swift index 3c18817..a972d68 100644 --- a/V2exOS/Views/ProfileView.swift +++ b/V2exOS/Views/ProfileView.swift @@ -64,6 +64,11 @@ struct ProfileView: View { HStack { TextField("Personal Access Token", text: $accessToken, prompt: Text("00000000-0000-0000-0000-000000000000")) .frame(width: 450) + .onChange(of: accessToken) { newValue in + // https://v2ex.com/settings/tokens 默认选中复制过来是不合法的 + accessToken = newValue.trimmingCharacters(in: .whitespacesAndNewlines) + } + Button { showingPopover.toggle()