increment sub count when necessary

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-07-16 13:36:33 -04:00
parent 95e9e4326a
commit dc4e3d7510
3 changed files with 8 additions and 3 deletions

View File

@@ -121,8 +121,10 @@ impl Columns {
let routes = intermediary_routes let routes = intermediary_routes
.into_iter() .into_iter()
.map(|r| match r { .map(|r| match r {
IntermediaryRoute::Timeline(timeline) => { IntermediaryRoute::Timeline(mut timeline) => {
let route = Route::timeline(timeline.kind.clone()); let route = Route::timeline(timeline.kind.clone());
timeline.subscription.increment();
timeline_cache timeline_cache
.timelines .timelines
.insert(timeline.kind.clone(), timeline); .insert(timeline.kind.clone(), timeline);

View File

@@ -1,7 +1,6 @@
use crate::{ use crate::{
actionbar::TimelineOpenResult, actionbar::TimelineOpenResult,
error::Error, error::Error,
//subscriptions::SubRefs,
timeline::{Timeline, TimelineKind}, timeline::{Timeline, TimelineKind},
}; };
@@ -105,7 +104,8 @@ impl TimelineCache {
} }
pub fn insert(&mut self, id: TimelineKind, timeline: Timeline) { pub fn insert(&mut self, id: TimelineKind, timeline: Timeline) {
if let Some(_cur_timeline) = self.timelines.get_mut(&id) { if let Some(cur_timeline) = self.timelines.get_mut(&id) {
cur_timeline.subscription.increment();
return; return;
}; };
@@ -205,6 +205,8 @@ impl TimelineCache {
); );
}; };
timeline.subscription.increment();
open_result open_result
} }

View File

@@ -486,6 +486,7 @@ pub fn setup_new_timeline(
for relay in &mut pool.relays { for relay in &mut pool.relays {
send_initial_timeline_filter(since_optimize, subs, relay, timeline, accounts); send_initial_timeline_filter(since_optimize, subs, relay, timeline, accounts);
} }
timeline.subscription.increment();
} }
/// Send initial filters for a specific relay. This typically gets called /// Send initial filters for a specific relay. This typically gets called