Forgot check for notifications permission

This commit is contained in:
Shinokuni 2024-08-08 18:07:10 +02:00
parent ba964ccce2
commit f7cd8ac998
1 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,5 @@
package com.readrops.app.sync
import android.annotation.SuppressLint
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
@ -159,7 +158,6 @@ class SyncWorker(
return workResult to syncResults
}
@SuppressLint("MissingPermission")
private suspend fun refreshLocalAccount(
repository: BaseRepository,
account: Account,
@ -184,10 +182,13 @@ class SyncWorker(
val result = repository.synchronize(
selectedFeeds = feeds,
onUpdate = { feed ->
notificationBuilder.setContentText(feed.name)
.setStyle(NotificationCompat.BigTextStyle().bigText(feed.name))
.setProgress(feedMax, ++feedCount, false)
notificationManager.notify(SYNC_NOTIFICATION_ID, notificationBuilder.build())
if (notificationManager.areNotificationsEnabled()) {
notificationBuilder.setContentText(feed.name)
.setStyle(NotificationCompat.BigTextStyle().bigText(feed.name))
.setProgress(feedMax, ++feedCount, false)
notificationManager.notify(SYNC_NOTIFICATION_ID, notificationBuilder.build())
}
setProgress(
workDataOf(