2021-06-14 18:05:02 +00:00
|
|
|
import AVFoundation
|
2021-06-11 21:11:59 +00:00
|
|
|
import Foundation
|
|
|
|
|
2021-06-14 18:05:02 +00:00
|
|
|
final class AppState: ObservableObject {
|
2021-06-11 21:11:59 +00:00
|
|
|
@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
|
|
|
}
|
|
|
|
}
|