Skip to content

Commit 10eb089

Browse files
committed
use relative time for polling and minor visual adjustments
1 parent 4ee92b9 commit 10eb089

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

Pangolin/Managers/AuthManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class AuthManager: ObservableObject {
135135
try await UNUserNotificationCenter.current().add(request)
136136

137137
// Poll for verification
138-
let expiresAt = Date(timeIntervalSince1970: TimeInterval(startResponse.expiresAt / 1000))
138+
let expiresAt = Date().addingTimeInterval(TimeInterval(startResponse.expiresInSeconds))
139139
var verified = false
140140
var sessionToken: String?
141141

Pangolin/Models/Models.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct DeviceAuthStartRequest: Codable {
5151

5252
struct DeviceAuthStartResponse: Codable {
5353
let code: String
54-
let expiresAt: Int64
54+
let expiresInSeconds: Int64
5555
}
5656

5757
struct DeviceAuthPollResponse: Codable {

Pangolin/PangolinApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct PangolinApp: App {
102102
}
103103
}
104104
.windowStyle(.hiddenTitleBar)
105-
.defaultSize(width: 500, height: 450)
105+
.defaultSize(width: 440, height: 300)
106106
.windowResizability(.contentSize)
107107
.commands {
108108
CommandGroup(replacing: .newItem) {}

Pangolin/Views/LoginView.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ struct LoginView: View {
5858
.frame(height: 60)
5959
Spacer()
6060
}
61-
.padding(.top, 10)
62-
.padding(.bottom, 10)
61+
.padding(.bottom, 15)
6362
Spacer()
6463
}
6564

@@ -124,8 +123,8 @@ struct LoginView: View {
124123
}
125124
}
126125
}
127-
.padding()
128-
.frame(width: 450, height: 400)
126+
.frame(width: 440, height: 300)
127+
.padding(12)
129128
.onChange(of: authManager.deviceAuthCode) { oldValue, newValue in
130129
// Auto-open browser when code is generated
131130
if let code = newValue, !hasAutoOpenedBrowser {
@@ -156,7 +155,7 @@ struct LoginView: View {
156155
}
157156

158157
private var hostingSelectionView: some View {
159-
VStack(alignment: .center, spacing: 16) {
158+
VStack(alignment: .center, spacing: 8) {
160159
Button(action: {
161160
hostingOption = .cloud
162161
// Immediately start device auth flow for cloud
@@ -372,7 +371,7 @@ struct LoginView: View {
372371
isLoggingIn = false
373372

374373
// Close window after 2 seconds
375-
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
374+
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
376375
closeWindow()
377376
}
378377
}

Pangolin/Views/MainWindowView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ struct MainWindowView: View {
132132

133133
// Set window to not be resizable
134134
window.isMovableByWindowBackground = false
135+
136+
// Set window size explicitly
137+
var frame = window.frame
138+
frame.size = NSSize(width: 440, height: 300)
139+
window.setContentSize(frame.size)
135140
}
136141
}
137142

Pangolin/Views/MenuBarView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ struct OrganizationsMenu: View {
363363
Text(organizations.count == 1 ? "1 Organization" : "\(organizations.count) Organizations")
364364
.foregroundColor(.secondary)
365365

366+
Divider()
367+
366368
ForEach(organizations, id: \.orgId) { org in
367369
Button {
368370
Task {

0 commit comments

Comments
 (0)