Skip to content

Commit c6399dd

Browse files
committed
fix: address PR review — defer notify, localize strings, add welcome trigger, changelog
1 parent a8bfbaf commit c6399dd

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Pro license gating for Safe Mode (Touch ID) and XLSX export
13+
- License activation dialog
14+
1215
- Reusable SSH tunnel profiles: save SSH configurations once and select them across multiple connections
1316
- Ctrl+HJKL navigation as arrow key alternative for keyboards without dedicated arrow keys
1417
- Amazon DynamoDB database support with PartiQL queries, AWS IAM/Profile/SSO authentication, GSI/LSI browsing, table scanning, capacity display, and DynamoDB Local support

TablePro/Core/Services/Licensing/LicenseManager.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,26 +247,23 @@ final class LicenseManager {
247247
/// Evaluate current license status based on expiration, grace period, and signature validity
248248
private func evaluateStatus() {
249249
let previousStatus = status
250+
defer { notifyIfChanged(from: previousStatus) }
250251

251252
guard let license else {
252253
status = .unlicensed
253-
notifyIfChanged(from: previousStatus)
254254
return
255255
}
256256

257257
// Check server-reported status
258258
switch license.status {
259259
case .suspended:
260260
status = .suspended
261-
notifyIfChanged(from: previousStatus)
262261
return
263262
case .expired:
264263
status = .expired
265-
notifyIfChanged(from: previousStatus)
266264
return
267265
case .deactivated:
268266
status = .deactivated
269-
notifyIfChanged(from: previousStatus)
270267
return
271268
default:
272269
break
@@ -275,19 +272,16 @@ final class LicenseManager {
275272
// Check local expiration
276273
if license.isExpired {
277274
status = .expired
278-
notifyIfChanged(from: previousStatus)
279275
return
280276
}
281277

282278
// Check grace period
283279
if license.daysSinceLastValidation > gracePeriodDays {
284280
status = .validationFailed
285-
notifyIfChanged(from: previousStatus)
286281
return
287282
}
288283

289284
status = .active
290-
notifyIfChanged(from: previousStatus)
291285
}
292286

293287
private func notifyIfChanged(from previousStatus: LicenseStatus) {

TablePro/Views/Connection/ConnectionFormView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ struct ConnectionFormView: View { // swiftlint:disable:this type_body_length
377377
}
378378
Button(String(localized: "OK"), role: .cancel) {}
379379
} message: {
380-
Text("Safe Mode, Safe Mode (Full), and Read-Only require a Pro license.")
380+
Text(String(localized: "Safe Mode, Safe Mode (Full), and Read-Only require a Pro license."))
381381
}
382382
}
383383
}

TablePro/Views/Connection/WelcomeWindowView.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,19 @@ struct WelcomeWindowView: View {
170170
Text("Version \(Bundle.main.appVersion)")
171171
.font(.system(size: ThemeEngine.shared.activeTheme.typography.medium))
172172
.foregroundStyle(.secondary)
173+
174+
if LicenseManager.shared.status.isValid {
175+
Label("Pro", systemImage: "checkmark.seal.fill")
176+
.font(.system(size: ThemeEngine.shared.activeTheme.typography.small, weight: .medium))
177+
.foregroundStyle(.green)
178+
} else {
179+
Button(action: { showActivationSheet = true }) {
180+
Text("Activate License")
181+
.font(.system(size: ThemeEngine.shared.activeTheme.typography.small))
182+
}
183+
.buttonStyle(.plain)
184+
.foregroundStyle(.secondary)
185+
}
173186
}
174187
}
175188

TablePro/Views/Toolbar/SafeModeBadgeView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct SafeModeBadgeView: View {
6666
}
6767
Button(String(localized: "OK"), role: .cancel) {}
6868
} message: {
69-
Text("Safe Mode, Safe Mode (Full), and Read-Only require a Pro license.")
69+
Text(String(localized: "Safe Mode, Safe Mode (Full), and Read-Only require a Pro license."))
7070
}
7171
.sheet(isPresented: $showActivationSheet) {
7272
LicenseActivationSheet()

0 commit comments

Comments
 (0)