mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 23:46:41 +02:00
fix: Make task uuid selection more sticky
This commit is contained in:
parent
2f8f245a97
commit
6869a8fd6a
1 changed files with 10 additions and 0 deletions
10
src/app.rs
10
src/app.rs
|
@ -1236,6 +1236,13 @@ impl TaskwarriorTui {
|
|||
|
||||
pub fn update(&mut self, force: bool) -> Result<()> {
|
||||
if force || self.dirty || self.tasks_changed_since(self.last_export).unwrap_or(true) {
|
||||
let task_uuids = self.selected_task_uuids();
|
||||
if self.current_selection_uuid.is_none() && task_uuids.len() == 1 {
|
||||
if let Some(uuid) = task_uuids.get(0) {
|
||||
self.current_selection_uuid = Some(*uuid);
|
||||
}
|
||||
}
|
||||
|
||||
self.last_export = Some(std::time::SystemTime::now());
|
||||
self.task_report_table.export_headers(None, &self.report)?;
|
||||
self.export_tasks()?;
|
||||
|
@ -1605,6 +1612,9 @@ impl TaskwarriorTui {
|
|||
let mut task_uuids = vec![];
|
||||
|
||||
for s in selected {
|
||||
if self.tasks.is_empty() {
|
||||
break;
|
||||
}
|
||||
let task_id = self.tasks[s].id().unwrap_or_default();
|
||||
let task_uuid = *self.tasks[s].uuid();
|
||||
task_uuids.push(task_uuid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue