fix user server future

This commit is contained in:
Evan Almloff committed 2024-02-02 18:01:57 -06:00
1 parent 1c4e1d84ea
commit 1afada528d
3 files changed
+13 -7

No files matched your search

@@ -18,8 +18,11 @@ where
// We're doing this regardless so inputs get tracked, even if we drop the future before polling it
let user_fut = cb.call();
let currently_in_first_run = first_run.cloned();
// If this is the first run and we are on the web client, the data might be cached
if *first_run.peek() {
if currently_in_first_run {
tracing::info!("First run of use_server_future");
// This is no longer the first run
first_run.set(false);
@@ -34,7 +37,7 @@ where
// If this is the first run and we are on the server, cache the data
#[cfg(feature = "ssr")]
if *first_run.peek() {
if currently_in_first_run {
let _ = crate::server_context::server_context().push_html_data(&out);
}