Apply suggestions from code review

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
Catting 2024-08-25 16:05:25 -05:00 committed by GitHub
parent 980874b260
commit 84ff6efd1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 8 deletions

View File

@ -86,7 +86,6 @@ internal class DownloadNotifier(private val context: Context) {
addAction(
R.drawable.ic_book_24dp,
context.stringResource(MR.strings.action_show_manga),
NotificationReceiver.openEntryPendingActivity(context, download.manga.id),
)
}
@ -181,7 +180,6 @@ internal class DownloadNotifier(private val context: Context) {
addAction(
R.drawable.ic_book_24dp,
context.stringResource(MR.strings.action_show_manga),
NotificationReceiver.openEntryPendingActivity(context, mangaId),
)
}
@ -218,7 +216,6 @@ internal class DownloadNotifier(private val context: Context) {
addAction(
R.drawable.ic_book_24dp,
context.stringResource(MR.strings.action_show_manga),
NotificationReceiver.openEntryPendingActivity(context, mangaId),
)
}

View File

@ -493,11 +493,11 @@ class NotificationReceiver : BroadcastReceiver() {
* @param mangaId id of the entry to open
*/
internal fun openEntryPendingActivity(context: Context, mangaId: Long): PendingIntent {
val newIntent =
Intent(context, MainActivity::class.java).setAction(Constants.SHORTCUT_MANGA)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
.putExtra(Constants.MANGA_EXTRA, mangaId)
.putExtra("notificationId", mangaId.hashCode())
val newIntent = Intent(context, MainActivity::class.java).setAction(Constants.SHORTCUT_MANGA)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
.putExtra(Constants.MANGA_EXTRA, mangaId)
.putExtra("notificationId", mangaId.hashCode())
return PendingIntent.getActivity(
context,
mangaId.hashCode(),