Skip to content

Commit

Permalink
Reuse all media notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
MarmadileManteater committed Feb 9, 2024
1 parent f10296b commit 50fa95f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ class FreeTubeJavaScriptInterface {
val notificationIntent = Intent(Intent.ACTION_MAIN)
.addCategory(Intent.CATEGORY_LAUNCHER)
.setClass(context, MainActivity::class.java)

// always reuse notification
if (lastNotification != null) {
lastNotification!!.actions = actions
return lastNotification
}

return Notification.Builder(context, CHANNEL_ID)
.setStyle(getMediaStyle())
.setSmallIcon(R.drawable.ic_media_notification_icon)
Expand Down

0 comments on commit 50fa95f

Please sign in to comment.