mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 05:40:31 +05:30
Merge pull request #1631 from Bnyro/master
Fix the wrong error on the subscriptions page
This commit is contained in:
commit
441087d871
@ -100,18 +100,21 @@ class BackgroundMode : Service() {
|
||||
*/
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
val channelId = BACKGROUND_CHANNEL_ID
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val channel = NotificationChannel(
|
||||
channelId,
|
||||
BACKGROUND_CHANNEL_ID,
|
||||
"Background Service",
|
||||
NotificationManager.IMPORTANCE_DEFAULT
|
||||
)
|
||||
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
||||
notificationManager.createNotificationChannel(channel)
|
||||
val notification: Notification = Notification.Builder(this, channelId)
|
||||
|
||||
// see https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)
|
||||
val notification: Notification = Notification.Builder(this, BACKGROUND_CHANNEL_ID)
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
.setContentText(getString(R.string.playingOnBackground)).build()
|
||||
.setContentText(getString(R.string.playingOnBackground))
|
||||
.build()
|
||||
|
||||
startForeground(PLAYER_NOTIFICATION_ID, notification)
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,10 @@ class SubscriptionsFragment : BaseFragment() {
|
||||
|
||||
// listen for error responses
|
||||
viewModel.errorResponse.observe(viewLifecycleOwner) {
|
||||
if (it) Toast.makeText(context, R.string.server_error, Toast.LENGTH_SHORT).show()
|
||||
if (it) {
|
||||
Toast.makeText(context, R.string.server_error, Toast.LENGTH_SHORT).show()
|
||||
viewModel.errorResponse.value = false
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.videoFeed.observe(viewLifecycleOwner) {
|
||||
|
Loading…
Reference in New Issue
Block a user