feat: add an artificial task to empty the inbox
All checks were successful
conventional commit messages check / conventional commit messages check (pull_request) Successful in 19s
actionlint check / actionlint check (pull_request) Successful in 25s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 6s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 21s
GitLeaks check / GitLeaks check (pull_request) Successful in 20s
hadolint check / hadolint check (pull_request) Successful in 19s
htmlhint check / htmlhint check (pull_request) Successful in 57s
checkov check / checkov check (pull_request) Successful in 1m51s
markdownlint check / markdownlint check (pull_request) Successful in 47s
ShellCheck check / ShellCheck check (pull_request) Successful in 42s
Prettier check / Prettier check (pull_request) Successful in 1m0s
yamllint check / yamllint check (pull_request) Successful in 45s
Stylelint check / Stylelint check (pull_request) Successful in 59s
Rust check / Rust check (pull_request) Successful in 28m51s
All checks were successful
conventional commit messages check / conventional commit messages check (pull_request) Successful in 19s
actionlint check / actionlint check (pull_request) Successful in 25s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 6s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 21s
GitLeaks check / GitLeaks check (pull_request) Successful in 20s
hadolint check / hadolint check (pull_request) Successful in 19s
htmlhint check / htmlhint check (pull_request) Successful in 57s
checkov check / checkov check (pull_request) Successful in 1m51s
markdownlint check / markdownlint check (pull_request) Successful in 47s
ShellCheck check / ShellCheck check (pull_request) Successful in 42s
Prettier check / Prettier check (pull_request) Successful in 1m0s
yamllint check / yamllint check (pull_request) Successful in 45s
Stylelint check / Stylelint check (pull_request) Successful in 59s
Rust check / Rust check (pull_request) Successful in 28m51s
This commit is contained in:
@@ -9,7 +9,12 @@ use dioxus::dioxus_core::Element;
|
||||
use dioxus::prelude::*;
|
||||
|
||||
#[component]
|
||||
pub(crate) fn TaskList(tasks: Vec<TaskWithSubtasks>, class: Option<&'static str>) -> Element {
|
||||
pub(crate) fn TaskList(
|
||||
tasks: Vec<TaskWithSubtasks>,
|
||||
/// Whether to open and complete tasks on clicks.
|
||||
is_interactive: Option<bool>,
|
||||
class: Option<&'static str>,
|
||||
) -> Element {
|
||||
let navigator = use_navigator();
|
||||
rsx! {
|
||||
div {
|
||||
@@ -34,6 +39,9 @@ pub(crate) fn TaskList(tasks: Vec<TaskWithSubtasks>, class: Option<&'static str>
|
||||
onclick: {
|
||||
let task = task.clone();
|
||||
move |_| {
|
||||
if let Some(false) = is_interactive {
|
||||
return;
|
||||
}
|
||||
*TASK_BEING_EDITED.write() = Some(task.task.clone());
|
||||
navigator.push(Route::TaskFormPage);
|
||||
}
|
||||
@@ -49,6 +57,9 @@ pub(crate) fn TaskList(tasks: Vec<TaskWithSubtasks>, class: Option<&'static str>
|
||||
// To prevent editing the task.
|
||||
event.stop_propagation();
|
||||
async move {
|
||||
if let Some(false) = is_interactive {
|
||||
return;
|
||||
}
|
||||
let _ = complete_task(task.task.id).await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user