Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: canvas preview panic in Xcode resolved#82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionsCoder Desktop/Coder Desktop/State.swift
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,6 +25,7 @@ class AppState: ObservableObject {
// Stored in Keychain
@Published private(set) var sessionToken: String? {
didSet {
guard persistent else { return }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is already guarded inkeychainSet

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oh yes, it would have been wise of me to check that. 😅

I will keep it in for consistency with the setters above and below, as it appeared somewhat odd. This also ensures that we are doubly safe.

keychainSet(sessionToken, for: Keys.sessionToken)
}
}
Expand Down
2 changes: 1 addition & 1 deletionCoder Desktop/Coder Desktop/Views/LoginForm.swift
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -221,6 +221,6 @@ enum LoginField: Hashable {
#if DEBUG
#Preview {
LoginForm()
.environmentObject(AppState())
.environmentObject(AppState(persistent: false))
}
#endif
8 changes: 6 additions & 2 deletionsCoder Desktop/Coder Desktop/Views/VPNMenu.swift
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -104,8 +104,12 @@ func openSystemExtensionSettings() {

#if DEBUG
#Preview {
VPNMenu<PreviewVPN>().frame(width: 256)
let appState = AppState(persistent: false)
appState.login(baseAccessURL: URL(string: "http://127.0.0.1:8080")!, sessionToken: "")
// appState.clearSession()

return VPNMenu<PreviewVPN>().frame(width: 256)
.environmentObject(PreviewVPN())
.environmentObject(AppState(persistent: false))
.environmentObject(appState)
}
#endif
Loading

[8]ページ先頭

©2009-2025 Movatter.jp