Fix 5 build issues: add ButtonStyles to project, actor isolation, buffer mutability

- Re-ran xcodegen so ButtonStyles.swift is included (fixes PrimaryButtonStyle
  and ScaleButtonStyle not in scope in LoginView and LANTriggerSection)
- BackgroundTaskManager: access BackupEngine.shared inside @MainActor Task
  instead of nonisolated context
- SFTPService: change var buffer → let (never mutated)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Robin Kutesa
2026-05-16 10:55:54 +03:00
parent 04e7a77c1a
commit 56b43dca86
3 changed files with 10 additions and 8 deletions

View File

@@ -47,9 +47,8 @@ final class BackgroundTaskManager {
private static func handleBackupTask(_ task: BGProcessingTask) {
scheduleBackup()
let engine = BackupEngine.shared
task.expirationHandler = { Task { await engine.cancel() } }
Task {
task.expirationHandler = { Task { await BackupEngine.shared.cancel() } }
Task { @MainActor in
do {
let store = ConnectionStore.shared
guard let connection = store.savedConnection else {
@@ -57,7 +56,7 @@ final class BackgroundTaskManager {
return
}
let filter = store.backupFilter
_ = try await engine.run(connection: connection, filter: filter, triggeredByLAN: true)
_ = try await BackupEngine.shared.run(connection: connection, filter: filter, triggeredByLAN: true)
task.setTaskCompleted(success: true)
} catch {
task.setTaskCompleted(success: false)

View File

@@ -89,7 +89,7 @@ final class SFTPService: NASTransferProtocol {
filePath: remotePath,
flags: [.write, .create, .truncate]
) { file in
var buffer = ByteBuffer(data: data)
let buffer = ByteBuffer(data: data)
try await file.write(buffer, at: 0)
}
progress(total, total)