diff --git a/lib/shared/ancestor-threads.js b/lib/shared/ancestor-threads.js --- a/lib/shared/ancestor-threads.js +++ b/lib/shared/ancestor-threads.js @@ -3,6 +3,7 @@ import * as React from 'react'; import genesis from '../facts/genesis.js'; +import { useAllowOlmViaTunnelbrokerForDMs } from '../hooks/flag-hooks.js'; import { ancestorThreadInfos, threadInfoSelector, @@ -20,14 +21,23 @@ state => threadInfoSelector(state)[genesis().id], ); + const usingOlmViaTunnelbrokerForDMs = useAllowOlmViaTunnelbrokerForDMs(); + return React.useMemo(() => { if (!threadIsPending(threadInfo.id)) { return ancestorThreads.length > 1 ? ancestorThreads.slice(0, -1) : ancestorThreads; } - return genesisThreadInfo ? [genesisThreadInfo] : []; - }, [ancestorThreads, genesisThreadInfo, threadInfo.id]); + return genesisThreadInfo && !usingOlmViaTunnelbrokerForDMs + ? [genesisThreadInfo] + : []; + }, [ + ancestorThreads, + genesisThreadInfo, + threadInfo.id, + usingOlmViaTunnelbrokerForDMs, + ]); } export { useAncestorThreads };