Skip to content

Commit

Permalink
Hide livestream when video is available
Browse files Browse the repository at this point in the history
  • Loading branch information
mttcrsp committed Feb 6, 2021
1 parent 5bea23e commit 4849322
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions Sources/Views/EventView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,6 @@ final class EventView: UIStackView {
addArrangedSubview(trackView)
setCustomSpacing(20, after: trackView)

if showsLivestream {
let livestreamAction = #selector(didTapLivestream)
let livestreamButton = RoundedButton()
livestreamButton.titleLabel?.adjustsFontForContentSizeCategory = true
livestreamButton.addTarget(self, action: livestreamAction, for: .touchUpInside)
livestreamButton.setTitle(FOSLocalizedString("event.livestream"), for: .normal)
self.livestreamButton = livestreamButton
addArrangedSubview(livestreamButton)
setCustomSpacing(28, after: livestreamButton)

constraints.append(livestreamButton.widthAnchor.constraint(equalTo: widthAnchor))
}

if event.video != nil {
let videoAction = #selector(didTapVideo)
let videoButton = RoundedButton()
Expand All @@ -100,6 +87,17 @@ final class EventView: UIStackView {
constraints.append(videoButton.widthAnchor.constraint(equalTo: widthAnchor))

reloadPlaybackPosition()
} else if showsLivestream {
let livestreamAction = #selector(didTapLivestream)
let livestreamButton = RoundedButton()
livestreamButton.titleLabel?.adjustsFontForContentSizeCategory = true
livestreamButton.addTarget(self, action: livestreamAction, for: .touchUpInside)
livestreamButton.setTitle(FOSLocalizedString("event.livestream"), for: .normal)
self.livestreamButton = livestreamButton
addArrangedSubview(livestreamButton)
setCustomSpacing(28, after: livestreamButton)

constraints.append(livestreamButton.widthAnchor.constraint(equalTo: widthAnchor))
}

if !event.people.isEmpty, let people = event.formattedPeople {
Expand Down

0 comments on commit 4849322

Please sign in to comment.