add swiftUI code
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import Foundation
|
||||
import GRDB
|
||||
import Libbox
|
||||
|
||||
public extension Profile {
|
||||
nonisolated func updateRemoteProfile() async throws {
|
||||
if type != .remote {
|
||||
return
|
||||
}
|
||||
let remoteContent = try HTTPClient().getString(remoteURL)
|
||||
var error: NSError?
|
||||
LibboxCheckConfig(remoteContent, &error)
|
||||
if let error {
|
||||
throw error
|
||||
}
|
||||
try write(remoteContent)
|
||||
lastUpdated = Date()
|
||||
try await ProfileManager.update(self)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user