Skip to content

Commit

Permalink
Merge pull request #22 from puzzle-js/remove-query-param-source
Browse files Browse the repository at this point in the history
Remove query param source
  • Loading branch information
cihadhoruzoglu committed Mar 25, 2021
2 parents 06007f0 + 0699d1c commit 8cccebb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@puzzle-js/client-lib",
"main": "dist/index.js",
"version": "1.4.1",
"version": "1.4.2",
"author": "<emre.kul@trendyol.com>",
"license": "MIT",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ export class Core extends Module {
private static prepareQueryString(fragmentAttributes: Record<string, string>) {
const attributes = Object.assign(window.location.search.slice(1).split('&').reduce((dict: { [name: string]: string }, i) => {
const [key, value] = i.split('=');
if (typeof value !== "undefined" && key !== "source") {
if (typeof value !== "undefined") {
dict[key] = value;
}
return dict;
}, {}), fragmentAttributes);

delete attributes.source;
return Object.keys(attributes).reduce((query: string, key: string) => `${query}&${key}=${attributes[key]}`, '?__renderMode=stream');
}

Expand Down

0 comments on commit 8cccebb

Please sign in to comment.