diff --git a/src/mail/screens/CreateTask.py b/src/mail/screens/CreateTask.py index d26a3bc..549c69a 100644 --- a/src/mail/screens/CreateTask.py +++ b/src/mail/screens/CreateTask.py @@ -1,10 +1,12 @@ import logging +import asyncio from textual.screen import ModalScreen from textual.widgets import Input, Label, Button, ListView, ListItem from textual.containers import Vertical, Horizontal, Container from textual.binding import Binding from textual import on, work from src.services.task_client import create_task, get_backend_info +from src.utils.ipc import notify_refresh class CreateTaskScreen(ModalScreen): @@ -208,6 +210,8 @@ class CreateTaskScreen(ModalScreen): if success: self.app.show_status(f"Task created: {subject}", "success") + # Notify the tasks app to refresh + asyncio.create_task(notify_refresh("tasks", {"source": "mail"})) self.dismiss() else: self.app.show_status(f"Failed to create task: {result}", "error")