Skip to content

Commit 000c185

Browse files
committed
tasks: delete shortcut when task is deleted
1 parent 3191c3e commit 000c185

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/src/main/java/io/shubham0204/smollmandroid/ui/screens/manage_tasks/ManageTasksActivity.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ private fun TaskItem(
243243
task.shortcutId != null,
244244
onDismiss = { showTaskOptionsPopup = false },
245245
onDeleteTaskClick = {
246+
task.shortcutId?.let {
247+
ShortcutManagerCompat.removeDynamicShortcuts(context, listOf(it))
248+
onUpdateTask(task.copy(shortcutId = null))
249+
Toast.makeText(context, "Shortcut for task '${task.name}' removed", Toast.LENGTH_LONG).show()
250+
}
246251
onDeleteTaskClick()
247252
showTaskOptionsPopup = false
248253
},

0 commit comments

Comments
 (0)