diff --git a/stores/product-workspace/store.ts b/stores/product-workspace/store.ts index b815b37..26693e6 100644 --- a/stores/product-workspace/store.ts +++ b/stores/product-workspace/store.ts @@ -334,10 +334,15 @@ export const useProductWorkspaceStore = create()( await get().ensurePbiLoaded(pbiId, requestId) if (get().loading.activeRequestId !== requestId) return if (!productId) return - // T-857: cascade-restore + // T-857: cascade-restore. Alleen herstellen als de hint-story + // bij de nieuw-geselecteerde PBI hoort — anders blijft een task- + // selectie van een vorige PBI hangen (PBI-79 bugfix). const hint = readHints().perProduct[productId]?.lastActiveStoryId - if (hint && get().entities.storiesById[hint]) { - get().setActiveStory(hint) + if (hint) { + const hintStory = get().entities.storiesById[hint] + if (hintStory && hintStory.pbi_id === pbiId) { + get().setActiveStory(hint) + } } })() }