refactor: centralize channel ui metadata

This commit is contained in:
Peter Steinberger
2026-01-20 13:10:26 +00:00
parent 6f9861bb9b
commit fdb171cb15
19 changed files with 240 additions and 68 deletions

View File

@@ -55,8 +55,7 @@ struct CronJobEditor: View {
@State var postPrefix: String = "Cron"
var channelOptions: [String] {
let snapshot = self.channelsStore.snapshot
let ordered = snapshot?.channelOrder ?? []
let ordered = self.channelsStore.orderedChannelIds()
var options = ["last"] + ordered
let trimmed = self.channel.trimmingCharacters(in: .whitespacesAndNewlines)
if !trimmed.isEmpty, !options.contains(trimmed) {
@@ -68,7 +67,7 @@ struct CronJobEditor: View {
func channelLabel(for id: String) -> String {
if id == "last" { return "last" }
return self.channelsStore.snapshot?.channelLabels[id] ?? id
return self.channelsStore.resolveChannelLabel(id)
}
var body: some View {