missing update work state
This commit is contained in:
@@ -61,11 +61,14 @@ while True:
|
||||
file_mtime = task.get_file_mtime(None)
|
||||
|
||||
logger.debug(f"current_mtime: {current_mtime}, file_mtime:{file_mtime}")
|
||||
# First handle file changes
|
||||
if current_mtime != file_mtime:
|
||||
task_id = task.read_and_extract(None)
|
||||
logger.debug(f"task_id:{task_id}")
|
||||
task.file_to_db(None)
|
||||
if task_id != current_task: # Only update state if different
|
||||
state.save("current", task=task_id)
|
||||
current_task = task_id
|
||||
|
||||
current_task = state.retrieve("current").get("task")
|
||||
current_workspace = active_workspace()
|
||||
@@ -84,13 +87,14 @@ while True:
|
||||
)
|
||||
work_task_ids = {t["task_id"] for t in workspace_tasks if "task_id" in t}
|
||||
logger.debug(
|
||||
f"work_task_ids:{work_task_ids}, current_work_task: {current_work_task}"
|
||||
f"work_task_ids:{work_task_ids}, current_work_task: {current_work_task},current_task: {current_task}"
|
||||
)
|
||||
|
||||
if current_task in work_task_ids and current_task != current_work_task:
|
||||
state.save("current", task=current_work_task)
|
||||
task.db_to_file_as_is(None)
|
||||
# if current_task in work_task_ids and current_task != current_work_task:
|
||||
if current_task not in work_task_ids:
|
||||
current_task = current_work_task
|
||||
state.save("current", task=current_task)
|
||||
task.db_to_file_as_is(None)
|
||||
state.update_work_state(work_desktops[current_workspace], current_task)
|
||||
|
||||
# regular flow
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
work
|
||||
default |ffbe198e *
|
||||
dm |77532dd4
|
||||
default |ffbe198e
|
||||
dm |77532dd4 *
|
||||
vhs |c851ce32
|
||||
dlt |b4378ac5
|
||||
|
||||
|
||||
Reference in New Issue
Block a user