From fb02be2f44caffd50bbd8c2c4093112c4f2cae99 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 6 Jul 2024 04:54:22 +0200 Subject: [PATCH] fix(web): use create_effect rather than signal.track --- web/src/actors/posts.rs | 7 +++---- web/src/timeline/feed.rs | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/web/src/actors/posts.rs b/web/src/actors/posts.rs index 5e31f29a..674bc0bd 100644 --- a/web/src/actors/posts.rs +++ b/web/src/actors/posts.rs @@ -6,14 +6,13 @@ use crate::prelude::*; pub fn ActorPosts() -> impl IntoView { let feeds = use_context::().expect("missing feeds context"); let params = use_params::(); - Signal::derive(move || { - let id = params.get_untracked().ok().and_then(|x| x.id).unwrap_or_default(); + create_effect(move |_| { + let id = params.get().ok().and_then(|x| x.id).unwrap_or_default(); let tl_url = format!("{}/outbox/page", Uri::api(U::Actor, &id, false)); if !feeds.user.next.get_untracked().starts_with(&tl_url) { feeds.user.reset(Some(tl_url)); } - id - }).track(); + }); view! { "🖂"" "posts diff --git a/web/src/timeline/feed.rs b/web/src/timeline/feed.rs index 48f6c544..0a93fd8e 100644 --- a/web/src/timeline/feed.rs +++ b/web/src/timeline/feed.rs @@ -38,7 +38,7 @@ pub fn Feed(tl: Timeline) -> impl IntoView { #[component] pub fn HashtagFeed(tl: Timeline) -> impl IntoView { let params = use_params::(); - Signal::derive(move || { + create_effect(move |_| { let current_tag = tl.next.get_untracked() .split('/') .last() @@ -51,7 +51,7 @@ pub fn HashtagFeed(tl: Timeline) -> impl IntoView { if new_tag != current_tag { tl.reset(Some(Uri::api(U::Hashtag, &format!("{new_tag}/page"), false))); } - }).track(); + }); view! { } }