mirror of
https://github.com/status-im/realm-js.git
synced 2025-02-20 02:18:26 +00:00
Automatically create the async query when converting to a TableView
This commit is contained in:
parent
8f668fdf09
commit
934263f76a
@ -177,9 +177,14 @@ void Results::update_tableview()
|
|||||||
m_mode = Mode::TableView;
|
m_mode = Mode::TableView;
|
||||||
break;
|
break;
|
||||||
case Mode::TableView:
|
case Mode::TableView:
|
||||||
if (m_live) {
|
if (!m_live) {
|
||||||
m_table_view.sync_if_needed();
|
return;
|
||||||
}
|
}
|
||||||
|
if (!m_realm->config().read_only && !m_realm->is_in_transaction() && !m_background_query) {
|
||||||
|
m_background_query = std::make_shared<_impl::AsyncQuery>(*this);
|
||||||
|
_impl::RealmCoordinator::register_query(m_background_query);
|
||||||
|
}
|
||||||
|
m_table_view.sync_if_needed();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user