yattee/Model/AppState.swift

20 lines
434 B
Swift
Raw Normal View History

2021-06-11 21:11:59 +00:00
import Foundation
class AppState: ObservableObject {
@Published var showingChannel = false
2021-06-11 22:49:42 +00:00
@Published var channelID: String = ""
@Published var channel: String = ""
2021-06-11 21:11:59 +00:00
2021-06-11 21:40:35 +00:00
func openChannel(from video: Video) {
2021-06-11 21:11:59 +00:00
channel = video.author
channelID = video.channelID
showingChannel = true
}
func closeChannel() {
showingChannel = false
2021-06-11 22:49:42 +00:00
channel = ""
channelID = ""
2021-06-11 21:11:59 +00:00
}
}