Skip to content

Commit 76acd3f

Browse files
committed
fix(message-blocks-observer): update fiber node path
1 parent 6ff6050 commit 76acd3f

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "complexity",
33
"displayName": "Complexity - Perplexity AI Supercharged",
4-
"version": "1.10.1.0",
4+
"version": "1.10.2.0",
55
"author": "pnd280",
66
"description": "Supercharge your Perplexity AI",
77
"type": "module",

src/plugins/_core/react-vdom/actions/get-messages.ts

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,37 @@ export function getMessages(): MessageBlockFiberData[] | null {
3030
return findReactFiberNodeValue({
3131
fiberNode,
3232
condition: (node) => {
33-
return node.return.memoizedState.memoizedState.results != null;
33+
return (
34+
node.return.memoizedState.next.next.memoizedState.current.results !=
35+
null
36+
);
3437
},
3538
select: (node): MessageBlockFiberData[] => {
36-
return (node.return.memoizedState.memoizedState.results as any[]).map(
37-
(entry) => ({
38-
title: entry.query_str,
39-
backendUuid: entry.backend_uuid,
40-
41-
answer: (entry.blocks as any[])
42-
.filter((block) => block.intended_usage === "ask_text")
43-
.map((chunk: any) => chunk.markdown_block.chunks.join(""))
44-
.join(""),
45-
webResults: (entry.blocks as any[])
46-
.filter((block) => block.intended_usage === "web_results")
47-
.map((chunk: any) =>
48-
chunk.web_result_block.web_results.map((result: any) => ({
49-
name: result.name,
50-
url: result.url,
51-
snippet: result.snippet,
52-
})),
53-
)
54-
.flat(),
39+
return (
40+
node.return.memoizedState.next.next.memoizedState.current
41+
.results as any[]
42+
).map((entry) => ({
43+
title: entry.query_str,
44+
backendUuid: entry.backend_uuid,
45+
answer: (entry.blocks as any[])
46+
.filter((block) => block.intended_usage === "ask_text")
47+
.map((chunk: any) => chunk.markdown_block.chunks.join(""))
48+
.join(""),
49+
webResults: (entry.blocks as any[])
50+
.filter((block) => block.intended_usage === "web_results")
51+
.map((chunk: any) =>
52+
chunk.web_result_block.web_results.map((result: any) => ({
53+
name: result.name,
54+
url: result.url,
55+
snippet: result.snippet,
56+
})),
57+
)
58+
.flat(),
5559

56-
displayModel: entry.display_model,
57-
isInFlight: entry.status !== "COMPLETED",
58-
authorUuid: entry.author_id ?? null,
59-
}),
60-
);
60+
displayModel: entry.display_model,
61+
isInFlight: entry.status !== "COMPLETED",
62+
authorUuid: entry.author_id ?? null,
63+
}));
6164
},
6265
});
6366
})();

0 commit comments

Comments
 (0)