Fix crash on request pin shortcut
This commit is contained in:
@@ -76,12 +76,18 @@ class AppShortcutManager @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun requestPinShortcut(manga: Manga): Boolean {
|
suspend fun requestPinShortcut(manga: Manga): Boolean = try {
|
||||||
return ShortcutManagerCompat.requestPinShortcut(context, buildShortcutInfo(manga), null)
|
ShortcutManagerCompat.requestPinShortcut(context, buildShortcutInfo(manga), null)
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
e.printStackTraceDebug()
|
||||||
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun requestPinShortcut(source: MangaSource): Boolean {
|
suspend fun requestPinShortcut(source: MangaSource): Boolean = try {
|
||||||
return ShortcutManagerCompat.requestPinShortcut(context, buildShortcutInfo(source), null)
|
ShortcutManagerCompat.requestPinShortcut(context, buildShortcutInfo(source), null)
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
e.printStackTraceDebug()
|
||||||
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|||||||
Reference in New Issue
Block a user