Skip to content

Commit d7750ff

Browse files
committed
feat: fix type error
1 parent 046eda3 commit d7750ff

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn component() -> impl IntoView {
4949
)
5050
.child(
5151
div()
52-
.child(query_editor::component(tabs.selected_tab.get()))
52+
.child(query_editor::component(move || tabs.selected_tab.get()))
5353
.child(query_table::component()),
5454
),
5555
)

src/query_editor.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ use crate::{
1515

1616
pub type ModelCell = Rc<RefCell<Option<CodeEditor>>>;
1717

18-
pub fn component(index: usize) -> impl IntoView {
19-
logging::log!("{:?}", index);
18+
pub fn component<F>(index: F) -> impl IntoView
19+
where
20+
F: Fn() -> usize,
21+
{
2022
let query_store = use_context::<QueryStore>().unwrap();
2123
let run_query = create_action(move |query_store: &QueryStore| {
2224
let query_store = *query_store;

src/store/editor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ impl EditorStore {
3232

3333
pub fn get_active_editor(&self) -> RwSignal<ModelCell> {
3434
let selected_tab = use_context::<Tabs>().unwrap().selected_tab.get_untracked();
35+
logging::log!("{:?}", selected_tab);
3536

36-
self.editors[selected_tab].clone()
37+
self.editors[selected_tab]
3738
}
3839

3940
pub fn get_editor_value(&self) -> String {

0 commit comments

Comments
 (0)