Skip to content

Commit

Permalink
Merge pull request #291 from metrico/dev
Browse files Browse the repository at this point in the history
hotfix: url decode
  • Loading branch information
jacovinus authored Feb 24, 2023
2 parents 25f36b0 + 56e650a commit 723bedb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/components/QueryItem/QueriesContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ const QueriesContainerStyled = styled.div`
`;
export default function QueriesContainer(props: any) {
const { queries } = props;
const queriesLoad = useMemo(()=>queries,[queries])

const queriesLoad = useMemo(() => {
return queries;
}, [queries]);
return (
<QueriesContainerStyled>
{queriesLoad &&
queriesLoad?.length > 0 &&
queriesLoad.map((query: any, idx: number) => (
<QueryItem
{...props}
data={query}
key={idx} />
<QueryItem {...props} data={query} key={idx} />
))}
</QueriesContainerStyled>
);
Expand Down
4 changes: 3 additions & 1 deletion src/helpers/UpdateStateFromQueryParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ export function UpdateStateFromQueryParams() {
[]
);

dispatch(STORE_ACTIONS[param](parsed));
if(parsed?.length > 0) {
dispatch(STORE_ACTIONS[param](parsed));
}
} catch (e) {
console.log(e);
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/Main/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function updateDataSourcesWithUrl(

if (apiUrl === "") {
urlApi = true;
apiUrl = url;
apiUrl = decodeURIComponent(url);
}

const dsCP = [...dataSources];
Expand Down

0 comments on commit 723bedb

Please sign in to comment.