Skip to content

Commit

Permalink
BugFix: album with no artist displayes "show artist"
Browse files Browse the repository at this point in the history
  • Loading branch information
BLeeEZ committed Jun 9, 2021
1 parent 56ff094 commit 3ba54b4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Amperfy/Screens/View/AlbumDetailTableHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ class AlbumDetailTableHeader: UIView {
}
}))
}
alert.addAction(UIAlertAction(title: "Show artist", style: .default, handler: { _ in
let artistDetailVC = ArtistDetailVC.instantiateFromAppStoryboard()
artistDetailVC.artist = album.artist
if let navController = self.rootView?.navigationController {
navController.pushViewController(artistDetailVC, animated: true)
}
}))
if let artist = album.artist {
alert.addAction(UIAlertAction(title: "Show artist", style: .default, handler: { _ in
let artistDetailVC = ArtistDetailVC.instantiateFromAppStoryboard()
artistDetailVC.artist = artist
if let navController = self.rootView?.navigationController {
navController.pushViewController(artistDetailVC, animated: true)
}
}))
}
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel))
alert.pruneNegativeWidthConstraintsToAvoidFalseConstraintWarnings()
return alert
Expand Down

0 comments on commit 3ba54b4

Please sign in to comment.