Skip to content

Commit

Permalink
show last ran time instead of updated_at always
Browse files Browse the repository at this point in the history
  • Loading branch information
anish-work committed Jan 16, 2025
1 parent 32b7afc commit 6c12b58
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions daras_ai_v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,7 @@ def render(self):
with gui.nav_item(url, active=tab == self.tab):
gui.html(tab.title)

if (
self.current_pr
and not self.current_pr.is_root()
and self.tab == RecipeTabs.run
):
if self.current_pr and self.tab == RecipeTabs.run:
with gui.div(
className="container-margin-reset d-none d-md-block",
style=dict(
Expand Down Expand Up @@ -490,8 +486,17 @@ def _render_unpublished_changes_indicator(self):
gui.html("Unpublished changes")

def _render_saved_timestamp(self, pr: PublishedRun):
last_run_at = gui.session_state.get(
StateKeys.updated_at, datetime.datetime.today()
)

if isinstance(last_run_at, str):
last_run_at = datetime.datetime.fromisoformat(last_run_at)

with gui.tag("span", className="text-muted"):
gui.write(f"{get_relative_time(pr.updated_at)}")
gui.write(
f"{get_relative_time(pr.updated_at if pr.is_root() else last_run_at)}"
)

def _render_options_button_with_dialog(self):
ref = gui.use_alert_dialog(key="options-modal")
Expand Down

0 comments on commit 6c12b58

Please sign in to comment.