Skip to content

Commit

Permalink
fix: pro search sources
Browse files Browse the repository at this point in the history
  • Loading branch information
pnd280 committed Nov 8, 2024
1 parent 2c6764b commit 917cc70
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Consider giving a star ⭐ on [Github](https://github.com/pnd280/complexity).

**EXPERIMENTAL** features are subjected to change/removal without prior notice.

## v0.0.5.7

_Release date: 8th Nov, 2024_

- **FIX**: Fixed a bug where the "Space & Focus" selectors causing Pro search to not pull any sources.

## v0.0.5.6

_Release date: 5th Nov, 2024_
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "complexity",
"displayName": "Complexity - Perplexity AI Supercharged",
"version": "0.0.5.6",
"version": "0.0.5.7",
"author": "pnd280",
"description": "⚡ Supercharge your Perplexity AI",
"type": "module",
Expand Down
16 changes: 14 additions & 2 deletions src/content-script/main-world/WebpageMessageInterceptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ export default class WebpageMessageInterceptor {
}
}

let filteredSources: string[] | null = Array.from(
new Set(newSources),
);

if (filteredSources.length === 0) filteredSources = null;

parsedPayload.data[1] = {
...parsedPayload.data[1],
model_preference: newModelPreference,
Expand All @@ -217,7 +223,7 @@ export default class WebpageMessageInterceptor {
isSpaceNFocusSelectorEnabled && selectedSpaceUuid
? selectedSpaceUuid
: parsedPayload.data[1].target_collection_uuid,
sources: Array.from(new Set(newSources)),
sources: filteredSources,
};

break;
Expand Down Expand Up @@ -265,12 +271,18 @@ export default class WebpageMessageInterceptor {
}
}

let filteredSources: string[] | null = Array.from(
new Set(newSources),
);

if (filteredSources.length === 0) filteredSources = null;

parsedPayload.data[1] = {
...parsedPayload.data[1],
model_preference: newModelPreference,
query_source: newQuerySource,
target_collection_uuid: newTargetCollectionUuid,
sources: Array.from(new Set(newSources)),
sources: filteredSources,
};

break;
Expand Down

0 comments on commit 917cc70

Please sign in to comment.