Only show "mark as watched" context menu entry when watch history is enabled

This commit is contained in:
TobiGr 2021-08-22 19:39:13 +02:00 committed by Tobi
parent ccc2d892c1
commit 8715e7dd98
1 changed files with 9 additions and 1 deletions

View File

@ -349,7 +349,15 @@ class FeedFragment : BaseStateFragment<FeedState>() {
)
)
}
if (item.streamType != StreamType.AUDIO_LIVE_STREAM && item.streamType != StreamType.LIVE_STREAM) {
// show "mark as watched" only when watch history is enabled
val isWatchHistoryEnabled = PreferenceManager
.getDefaultSharedPreferences(context)
.getBoolean(getString(R.string.enable_watch_history_key), false)
if (item.streamType != StreamType.AUDIO_LIVE_STREAM &&
item.streamType != StreamType.LIVE_STREAM &&
isWatchHistoryEnabled
) {
entries.add(
StreamDialogEntry.mark_as_watched
)