Fix crashes

This commit is contained in:
Arkadiusz Fal
2022-12-21 18:13:41 +01:00
parent 6594d5ba95
commit 18cbbd3c90
8 changed files with 26 additions and 17 deletions

View File

@@ -40,7 +40,9 @@ struct WatchView: View {
if finished, let watch {
PlayerModel.shared.removeWatch(watch)
} else {
Watch.markAsWatched(videoID: watch?.videoID ?? videoID, account: AccountsModel.shared.current, duration: watch?.videoDuration ?? duration, context: backgroundContext)
if let account = AccountsModel.shared.current {
Watch.markAsWatched(videoID: watch?.videoID ?? videoID, account: account, duration: watch?.videoDuration ?? duration, context: backgroundContext)
}
}
FeedModel.shared.calculateUnwatchedFeed()