commit 4fdbad0df82fa6a1942422423066995f021997f4
parent 043ccf2146f2a46d8766dbaaf1dafe6c1762b041
Author: William Casarin <jb55@jb55.com>
Date: Tue, 3 Sep 2024 11:11:38 -0700
fix bug where it was subscribing too many times
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/app.rs b/src/app.rs
@@ -100,7 +100,7 @@ fn relay_setup(pool: &mut RelayPool, ctx: &egui::Context) {
}
}
-fn send_initial_timeline_filter(damus: &mut Damus, timeline: usize) {
+fn send_initial_timeline_filter(damus: &mut Damus, timeline: usize, to: &str) {
let can_since_optimize = damus.since_optimize;
let filter_state = damus.timelines[timeline].filter.clone();
@@ -154,7 +154,8 @@ fn send_initial_timeline_filter(damus: &mut Damus, timeline: usize) {
.subscriptions()
.insert(sub_id.clone(), SubKind::Initial);
- damus.pool.subscribe(sub_id, new_filters);
+ let cmd = ClientMessage::req(sub_id, new_filters);
+ damus.pool.send_to(&cmd, to);
}
// we need some data first
@@ -179,7 +180,7 @@ fn send_initial_filters(damus: &mut Damus, relay_url: &str) {
let timelines = damus.timelines.len();
for i in 0..timelines {
- send_initial_timeline_filter(damus, i);
+ send_initial_timeline_filter(damus, i, relay_url);
}
}