Skip to content

Commit

Permalink
Don't persist blueprints for unknown apps (#2165)
Browse files Browse the repository at this point in the history
* Don't persist the blueprint for unknown app ids

* Less prominent text when no time has been selected
  • Loading branch information
emilk authored May 17, 2023
1 parent 5c652d2 commit 32812da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,20 @@ impl App {
);
}

let state: AppState = if startup_options.persist_state {
let mut state: AppState = if startup_options.persist_state {
storage
.and_then(|storage| eframe::get_value(storage, eframe::APP_KEY))
.unwrap_or_default()
} else {
AppState::default()
};

// Forget the blueprint we used for some unknown app,
// so we don't reuse it for some unrelated unknown app.
// This is in particularly important for `rerun foo.png`
// followed by `rerun bar.png`, which both uses the unknow App ID.
state.blueprints.remove(&ApplicationId::unknown());

let mut analytics = ViewerAnalytics::new();
analytics.on_viewer_started(&build_info, app_env);

Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/src/ui/viewport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ fn space_view_ui(
) {
let Some(latest_at) = ctx.rec_cfg.time_ctrl.time_int() else {
ui.centered_and_justified(|ui| {
ui.label(ctx.re_ui.warning_text("No time selected"));
ui.weak("No time selected");
});
return
};
Expand Down

0 comments on commit 32812da

Please sign in to comment.