[v25.1] fix crash when exceeding max shortcut number (#4415)

I made a mistake in https://github.com/tuskyapp/Tusky/pull/4389 🙄 

With `addDynamicShortcuts` the limit can still be exceeded,
`setDynamicShortcuts` is what we want.

Also, `setLongLived` says:

> Sets if a shortcut would be valid even if it has been
unpublished/invisible by the app (as a dynamic or pinned shortcut). If
it is long lived, it can be cached by various system services even after
it has been unpublished as a dynamic shortcut.

I don't think we want that so I removed it.
This commit is contained in:
Konrad Pozniak 2024-05-04 18:36:26 +02:00 committed by GitHub
parent e96ca01dec
commit 056aaa7e0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -89,12 +89,11 @@ class ShareShortcutHelper @Inject constructor(
.setCategories(setOf("com.keylesspalace.tusky.Share"))
.setShortLabel(account.displayName)
.setPerson(person)
.setLongLived(true)
.setIcon(icon)
.build()
}
ShortcutManagerCompat.addDynamicShortcuts(context, shortcuts)
ShortcutManagerCompat.setDynamicShortcuts(context, shortcuts)
}
}