Skip to content

Commit 1e25b8c

Browse files
committed
feed: Correctly update the stack details on workflow changes
Even if the feed component has not been initialized, correctly read from the feed list and update the stack details and stacks
1 parent 2245ab5 commit 1e25b8c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/desktop/src/lib/feed/feed.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ export class Feed {
200200

201201
private async handleLastAdded(entry: FeedEntry) {
202202
this.lastAddedId.set(entry.id);
203+
}
203204

205+
private handleNewItemObserved(entry: FeedEntry) {
204206
if (entry instanceof Workflow) {
205207
const stackId = entry.kind.subject?.stackId;
206208
if (stackId) this.stackService.invalidateStackDetailsUpdate(stackId);
@@ -297,7 +299,6 @@ export class Feed {
297299
}
298300

299301
async updateCombinedFeed() {
300-
if (!this.initialized) return;
301302
if (this.updateTimeout) {
302303
clearTimeout(this.updateTimeout);
303304
}
@@ -331,6 +332,12 @@ export class Feed {
331332
const existing = entries.find((entry) => entry.id === lessRecent.id);
332333
if (!existing) {
333334
lastAddedItem = lessRecent;
335+
336+
this.handleNewItemObserved(lastAddedItem);
337+
338+
if (!this.initialized) {
339+
return entries;
340+
}
334341
return [lessRecent, ...entries];
335342
}
336343
return entries;

0 commit comments

Comments
 (0)