Improve content saving, label editing

This commit is contained in:
Christoph Hagen
2025-05-02 22:11:43 +02:00
parent fea06a93b7
commit 1f4f32c9af
15 changed files with 274 additions and 150 deletions

View File

@ -1,17 +1,10 @@
import Foundation
final class ContentLabel: ObservableObject {
struct ContentLabel {
@Published
var icon: PageIcon
@Published
var value: String
init(icon: PageIcon, value: String) {
self.icon = icon
self.value = value
}
}
extension ContentLabel: Equatable {
@ -34,7 +27,7 @@ extension ContentLabel {
.init(icon: icon.rawValue, value: value)
}
convenience init?(context: LoadingContext, data: Data) {
init?(context: LoadingContext, data: Data) {
guard let icon = PageIcon(rawValue: data.icon) else {
context.error("Unknown label icon '\(data.icon)'")
return nil