Skip to content

Commit

Permalink
use current_sr.updated_at for last saved time
Browse files Browse the repository at this point in the history
  • Loading branch information
anish-work committed Jan 23, 2025
1 parent 6c12b58 commit fcfcb56
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions daras_ai_v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def render(self):
transform="translateY(-50%)",
),
):
self._render_saved_timestamp(self.current_pr)
self._render_saved_timestamp(self.current_pr, self.current_sr)
with gui.nav_tab_content():
self.render_selected_tab()

Expand Down Expand Up @@ -485,17 +485,10 @@ 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)

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

def _render_options_button_with_dialog(self):
Expand Down

0 comments on commit fcfcb56

Please sign in to comment.