2021-06-14 23:35:02 +05:30
|
|
|
import AVFoundation
|
2021-06-12 02:41:59 +05:30
|
|
|
import Foundation
|
|
|
|
|
2021-06-14 23:35:02 +05:30
|
|
|
final class AppState: ObservableObject {
|
2021-06-12 02:41:59 +05:30
|
|
|
@Published var showingChannel = false
|
2021-06-12 04:19:42 +05:30
|
|
|
@Published var channelID: String = ""
|
|
|
|
@Published var channel: String = ""
|
2021-06-12 02:41:59 +05:30
|
|
|
|
2021-06-12 03:10:35 +05:30
|
|
|
func openChannel(from video: Video) {
|
2021-06-12 02:41:59 +05:30
|
|
|
channel = video.author
|
|
|
|
channelID = video.channelID
|
|
|
|
showingChannel = true
|
|
|
|
}
|
|
|
|
|
|
|
|
func closeChannel() {
|
|
|
|
showingChannel = false
|
2021-06-12 04:19:42 +05:30
|
|
|
channel = ""
|
|
|
|
channelID = ""
|
2021-06-12 02:41:59 +05:30
|
|
|
}
|
|
|
|
}
|