Fix dislikes counter

This commit is contained in:
Arkadiusz Fal 2022-11-18 22:43:16 +01:00
parent 2dbc50dc71
commit a1ade66594
2 changed files with 4 additions and 5 deletions

View File

@ -134,11 +134,9 @@ struct Video: Identifiable, Equatable, Hashable {
}
var dislikesCount: String? {
guard (dislikes ?? 0) > 0 else {
return nil
}
guard let dislikes else { return nil }
return dislikes?.formattedAsAbbreviation()
return dislikes.formattedAsAbbreviation()
}
func thumbnailURL(quality: Thumbnail.Quality) -> URL? {

View File

@ -30,6 +30,7 @@ struct VideoDetails: View {
@EnvironmentObject<RecentsModel> private var recents
@EnvironmentObject<SubscriptionsModel> private var subscriptions
@Default(.enableReturnYouTubeDislike) private var enableReturnYouTubeDislike
@Default(.detailsToolbarPosition) private var detailsToolbarPosition
@Default(.playerSidebar) private var playerSidebar
@ -210,7 +211,7 @@ struct VideoDetails: View {
}
}
if Defaults[.enableReturnYouTubeDislike] {
if enableReturnYouTubeDislike {
Image(systemName: "hand.thumbsdown")
if let dislikes = video?.dislikesCount, player.videoBeingOpened.isNil {