Skip to content

Commit c2f541d

Browse files
committed
fix web build
1 parent c8610b0 commit c2f541d

File tree

1 file changed

+24
-4
lines changed
  • crates/viewer/re_viewer/src

1 file changed

+24
-4
lines changed

crates/viewer/re_viewer/src/web.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use re_log_types::{TableId, TableMsg, TimeReal};
1515
use re_memory::AccountingAllocator;
1616
use re_viewer_context::{AsyncRuntimeHandle, TimeBlueprintExt as _, open_url};
1717

18+
use crate::app::AppBlueprintCtx;
1819
use crate::app_state::recording_config_entry;
1920
use crate::history::install_popstate_listener;
2021
use crate::web_tools::{Callback, JsResultExt as _, StringOrStringArray};
@@ -438,7 +439,7 @@ impl WebHandle {
438439
//TODO(#10737): we should refer to logical recordings using store id (recording id is ambibuous)
439440
#[wasm_bindgen]
440441
pub fn set_active_timeline(&self, recording_id: &str, timeline_name: &str) {
441-
let Some(mut app) = self.runner.app_mut::<crate::App>() else {
442+
let Some(app) = self.runner.app_mut::<crate::App>() else {
442443
return;
443444
};
444445

@@ -475,7 +476,7 @@ impl WebHandle {
475476
//TODO(#10737): we should refer to logical recordings using store id (recording id is ambibuous)
476477
#[wasm_bindgen]
477478
pub fn set_time_for_timeline(&self, recording_id: &str, timeline_name: &str, time: f64) {
478-
let Some(mut app) = self.runner.app_mut::<crate::App>() else {
479+
let Some(app) = self.runner.app_mut::<crate::App>() else {
479480
return;
480481
};
481482

@@ -563,6 +564,7 @@ impl WebHandle {
563564
store_hub,
564565
state,
565566
egui_ctx,
567+
command_sender,
566568
..
567569
} = &mut *app;
568570

@@ -575,7 +577,25 @@ impl WebHandle {
575577
let Some(recording) = hub.store_bundle().get(&store_id) else {
576578
return;
577579
};
578-
let rec_cfg = recording_config_entry(&mut state.recording_configs, recording);
580+
581+
let Some(blueprint) = hub.active_blueprint_for_app(store_id.application_id()) else {
582+
return;
583+
};
584+
585+
let default_blueprint = hub.default_blueprint_for_app(store_id.application_id());
586+
587+
let blueprint_query =
588+
re_chunk::LatestAtQuery::latest(re_viewer_context::blueprint_timeline());
589+
590+
// Can't use `app.blueprint_ctx(...)` here because of borrow issues.
591+
let ctx = AppBlueprintCtx {
592+
command_sender,
593+
current_blueprint: blueprint,
594+
default_blueprint,
595+
blueprint_query,
596+
};
597+
598+
let rec_cfg = recording_config_entry(&mut state.recording_configs, recording, &ctx);
579599

580600
let play_state = if value {
581601
re_viewer_context::PlayState::Playing
@@ -586,7 +606,7 @@ impl WebHandle {
586606
rec_cfg
587607
.time_ctrl
588608
.write()
589-
.set_play_state(recording.times_per_timeline(), play_state);
609+
.set_play_state(recording.times_per_timeline(), play_state, &ctx);
590610
egui_ctx.request_repaint();
591611
}
592612
}

0 commit comments

Comments
 (0)