mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 17:14:21 +01:00
increment sub count when necessary
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -121,8 +121,10 @@ impl Columns {
|
||||
let routes = intermediary_routes
|
||||
.into_iter()
|
||||
.map(|r| match r {
|
||||
IntermediaryRoute::Timeline(timeline) => {
|
||||
IntermediaryRoute::Timeline(mut timeline) => {
|
||||
let route = Route::timeline(timeline.kind.clone());
|
||||
|
||||
timeline.subscription.increment();
|
||||
timeline_cache
|
||||
.timelines
|
||||
.insert(timeline.kind.clone(), timeline);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use crate::{
|
||||
actionbar::TimelineOpenResult,
|
||||
error::Error,
|
||||
//subscriptions::SubRefs,
|
||||
timeline::{Timeline, TimelineKind},
|
||||
};
|
||||
|
||||
@@ -105,7 +104,8 @@ impl TimelineCache {
|
||||
}
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -205,6 +205,8 @@ impl TimelineCache {
|
||||
);
|
||||
};
|
||||
|
||||
timeline.subscription.increment();
|
||||
|
||||
open_result
|
||||
}
|
||||
|
||||
|
||||
@@ -486,6 +486,7 @@ pub fn setup_new_timeline(
|
||||
for relay in &mut pool.relays {
|
||||
send_initial_timeline_filter(since_optimize, subs, relay, timeline, accounts);
|
||||
}
|
||||
timeline.subscription.increment();
|
||||
}
|
||||
|
||||
/// Send initial filters for a specific relay. This typically gets called
|
||||
|
||||
Reference in New Issue
Block a user