File tree Expand file tree Collapse file tree 5 files changed +13
-6
lines changed
chunter-resources/src/components
notification-resources/src Expand file tree Collapse file tree 5 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 2222 export let loadingOverlay: boolean = false
2323 export let onScroll: () => void = () => {}
2424 export let onResize: () => void = () => {}
25+ export let key: string
2526 </script >
2627
2728{#if loadingOverlay }
4142 {onScroll }
4243 {onResize }
4344>
44- <slot />
45+ {#key key }
46+ <slot />
47+ {/ key }
4548</Scroller >
4649
4750<style lang =" scss" >
Original file line number Diff line number Diff line change 611611 editLastMessage ()
612612 }
613613 }
614+ function getKey (messages : ActivityMessage []): string {
615+ return ` ${messages .length }-${Math .max (... messages .map ((m ) => m .modifiedOn ))} `
616+ }
614617 </script >
615618
616619<div class ="flex-col relative" class:h-full ={fullHeight }>
627630 loadingOverlay ={$isLoadingStore || ! isScrollInitialized }
628631 onScroll ={handleScroll }
629632 onResize ={handleResize }
633+ key ={getKey (messages )}
630634 >
631635 {#if showBlankView }
632636 <BlankView
Original file line number Diff line number Diff line change 168168
169169 function isChunterChannel (_class : Ref <Class <Doc >>, urlObjectClass ? : Ref <Class <Doc >>): boolean {
170170 const isActivityMessageContext = hierarchy .isDerived (_class , activity .class .ActivityMessage )
171- const chunterClass = isActivityMessageContext ? urlObjectClass ?? _class : _class
171+ const chunterClass = isActivityMessageContext ? ( urlObjectClass ?? _class ) : _class
172172 return hierarchy .isDerived (chunterClass , chunter .class .ChunterSpace )
173173 }
174174
Original file line number Diff line number Diff line change @@ -184,10 +184,10 @@ export async function selectInboxContext (
184184 : undefined
185185 const reactedTo = await client . findOne ( activity . class . ActivityMessage , { _id : notification . attachedTo } )
186186 const isThread = reactedTo != null && hierarchy . isDerived ( reactedTo . _class , chunter . class . ThreadMessage )
187- const channelId = isThread ? ( reactedTo as ThreadMessage ) ?. objectId : reactedTo ?. attachedTo ?? objectId
187+ const channelId = isThread ? ( reactedTo as ThreadMessage ) ?. objectId : ( reactedTo ?. attachedTo ?? objectId )
188188 const channelClass = isThread
189189 ? ( reactedTo as ThreadMessage ) ?. objectClass
190- : reactedTo ?. attachedToClass ?? objectClass
190+ : ( reactedTo ?. attachedToClass ?? objectClass )
191191
192192 void navigateToInboxDoc (
193193 context . _id ,
Original file line number Diff line number Diff line change @@ -617,10 +617,10 @@ export async function selectInboxContext (
617617 const thread = loc . path [ 4 ] === objectId ? objectId : undefined
618618 const reactedTo = await client . findOne ( activity . class . ActivityMessage , { _id : notification . attachedTo } )
619619 const isThread = reactedTo != null && hierarchy . isDerived ( reactedTo . _class , chunter . class . ThreadMessage )
620- const channelId = isThread ? ( reactedTo as ThreadMessage ) ?. objectId : reactedTo ?. attachedTo ?? objectId
620+ const channelId = isThread ? ( reactedTo as ThreadMessage ) ?. objectId : ( reactedTo ?. attachedTo ?? objectId )
621621 const channelClass = isThread
622622 ? ( reactedTo as ThreadMessage ) ?. objectClass
623- : reactedTo ?. attachedToClass ?? objectClass
623+ : ( reactedTo ?. attachedToClass ?? objectClass )
624624
625625 void navigateToInboxDoc (
626626 linkProviders ,
You can’t perform that action at this time.
0 commit comments