Skip to content

Commit

Permalink
Merge pull request #5 from bettyblocks/fix/decode-hash
Browse files Browse the repository at this point in the history
fix: decode hash
  • Loading branch information
RobinBetty authored Nov 22, 2019
2 parents f818208 + 867f724 commit 77d4ec9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function App(): JSX.Element {
const [prefabs, setPrefabs] = useState({} as Record<string, Prefab>);
const [names, setNames] = useState([] as string[]);
const history = useHistory();
const currentPath = history.location.hash.replace('#/', '');
const currentPath = decodeURI(history.location.hash.replace('#/', ''));
const classes: Record<string, string> = useStyles();
const selectedPrefab = prefabs[currentPath];

Expand All @@ -47,9 +47,9 @@ function App(): JSX.Element {
<Select
onChange={({
target: { value }
}: ChangeEvent<{ value: unknown }>): void =>
history.push(`/#/${value}`)
}
}: ChangeEvent<{ value: unknown }>): void => {
history.push(`/#/${value}`);
}}
names={names}
selected={currentPath}
/>
Expand Down

0 comments on commit 77d4ec9

Please sign in to comment.