Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into issue-#1448
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandSchtroumpf committed Sep 5, 2024
2 parents 77cb315 + 3589595 commit b1ff178
Show file tree
Hide file tree
Showing 23 changed files with 30 additions and 20 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/screenshots/strategy/overlapping/Overlapping/withdraw/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 30 additions & 20 deletions src/libs/routing/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,44 @@ export const parseSearchWith = (parser: (str: string) => any) => {

let query: Record<string, unknown> = decode(searchStr);

const skipParsing = (key: string) => {
if (key === 'settings') return true;
if (key === 'type') return true;
if (key === 'anchor') return true;
if (key === 'direction') return true;
if (key === 'buySettings') return true;
if (key === 'sellSettings') return true;
return false;
const keysToSkipParse = [
'settings',
'type',
'anchor',
'direction',
'buySettings',
'sellSettings',
'editType',
'action',
'buyAction',
'sellAction',
'chartType',
];

const skipParsing = (key: string) => keysToSkipParse.includes(key);

const formatNumberParam = (value: string): string => {
const number = /^\d*\.*\d*$/;
if (value.match(number)) return `"${formatNumber(value)}"`;
return value;
};

// Try to parse any query params that might be json
for (let key in query) {
if (!query[key]) continue;
if (
!query[key] ||
isAddress(String(query[key])) ||
isDate(String(query[key])) ||
skipParsing(key)
) {
// eslint-disable-next-line
query[key] = query[key];
} else {
const value = query[key];
if (typeof value === 'string') {
try {
query[key] = parser(value);
} catch (err) {
console.error(`Error parsing param for key ${key}: `, err);
}
)
continue;

const value = query[key];
if (typeof value === 'string') {
try {
query[key] = parser(formatNumberParam(value));
} catch (err) {
//
}
}
}
Expand Down

0 comments on commit b1ff178

Please sign in to comment.