Skip to content

Commit

Permalink
fix(navigator): cannot find images
Browse files Browse the repository at this point in the history
  • Loading branch information
shalluv committed Jan 7, 2024
1 parent 58446c7 commit 97d47cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Navigator/Guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ const Guide: FC<Props> = ({ images }) => {
if (from === -1 || to === -1 || from === to) return;
const f = from === 20 ? 15 : from + 1;
const t = to === 20 ? 15 : to + 1;
const pathSuffix = `/src/assets/map/${f}/${f} ไป ${t}`;
const data = images.find((image) => image.default.src.includes(pathSuffix));
const data = images.find((image) =>
image.default.src.includes(`/${f} ไป ${t}`)
);
setImage(data ? data.default.src : "");
}, [from, to]);

Expand Down

0 comments on commit 97d47cd

Please sign in to comment.