fix type error
This commit is contained in:
parent
8687f60b0e
commit
3b0926476f
1 changed files with 6 additions and 3 deletions
|
@ -6,7 +6,7 @@ import "katex/dist/katex.min.css";
|
||||||
import Point from "./components/Point";
|
import Point from "./components/Point";
|
||||||
import Path from "./components/Path";
|
import Path from "./components/Path";
|
||||||
import { SettingsBox } from "./SettingsContext";
|
import { SettingsBox } from "./SettingsContext";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback } from "react";
|
||||||
import { atom, useAtom, useSetAtom } from "jotai";
|
import { atom, useAtom, useSetAtom } from "jotai";
|
||||||
|
|
||||||
// https://threejs.org/manual/#en/align-html-elements-to-3d
|
// https://threejs.org/manual/#en/align-html-elements-to-3d
|
||||||
|
@ -45,7 +45,8 @@ function getInitialValue() {
|
||||||
|
|
||||||
export const stateAtom = atom<{ [_: string]: string }>(getInitialValue());
|
export const stateAtom = atom<{ [_: string]: string }>(getInitialValue());
|
||||||
|
|
||||||
export const updateStateAtom = atom(null, (get, set, newValue) => {
|
export const updateStateAtom = atom(null, (_, set, newValue) => {
|
||||||
|
// @ts-ignore
|
||||||
set(stateAtom, newValue);
|
set(stateAtom, newValue);
|
||||||
location.hash = btoa(JSON.stringify(newValue));
|
location.hash = btoa(JSON.stringify(newValue));
|
||||||
});
|
});
|
||||||
|
@ -79,7 +80,9 @@ const defaultValues: [string, string] = Object.fromEntries([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function parseCoord(s: string): coord {
|
function parseCoord(s: string): coord {
|
||||||
return offset(s.split("").map((n) => parseInt(n)));
|
// @ts-ignore
|
||||||
|
const t: [number, number, number] = s.split("").map((n) => parseInt(n));
|
||||||
|
return offset(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parsePath(s: string): [coord, coord] {
|
function parsePath(s: string): [coord, coord] {
|
||||||
|
|
Loading…
Reference in a new issue