Add preview support

This commit is contained in:
世界
2023-07-20 13:15:13 +08:00
parent fdbf50d875
commit 251f441a25
14 changed files with 135 additions and 59 deletions
+2 -5
View File
@@ -15,19 +15,16 @@ public class Profile: Record, Identifiable, ObservableObject {
@Published public var autoUpdate: Bool
public var lastUpdated: Date?
public init(id: Int64? = nil, name: String, order: UInt32 = 0, type: ProfileType, path: String, remoteURL: String? = nil) {
public init(id: Int64? = nil, name: String, order: UInt32 = 0, type: ProfileType, path: String, remoteURL: String? = nil, lastUpdated: Date? = nil) {
self.id = id
self.name = name
self.order = order
self.type = type
self.path = path
self.remoteURL = remoteURL
self.lastUpdated = lastUpdated
autoUpdate = false
lastUpdated = nil
if type == .remote {
lastUpdated = Date()
}
super.init()
}