Improve content saving, label editing
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user