undo ts ignore lines
This commit is contained in:
parent
58db12967a
commit
a8293784d2
@ -77,7 +77,6 @@ export function HomePage() {
|
|||||||
const data = await readFile(file)
|
const data = await readFile(file)
|
||||||
console.log("IMPORT", data)
|
console.log("IMPORT", data)
|
||||||
await JsonUtils.import(data)
|
await JsonUtils.import(data)
|
||||||
//@ts-ignore
|
|
||||||
window.location = "/"
|
window.location = "/"
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -55,7 +55,6 @@ export function Board({ boardId }: { boardId: string }) {
|
|||||||
(b) => String(b.id) === boardId || b.uuid === boardId
|
(b) => String(b.id) === boardId || b.uuid === boardId
|
||||||
)
|
)
|
||||||
if (!board) {
|
if (!board) {
|
||||||
// @ts-ignore
|
|
||||||
window.location = "/"
|
window.location = "/"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,6 @@ function BoardTagEditor({ tag }: { tag: Tag }) {
|
|||||||
|
|
||||||
<button onclick={_handleDeleteTag}>
|
<button onclick={_handleDeleteTag}>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" className="w-4 h-4 hover:text-red-500">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" className="w-4 h-4 hover:text-red-500">
|
||||||
{/* @ts-ignore*/}
|
|
||||||
<path fillRule="evenodd" d="M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z" clipRule="evenodd" />
|
<path fillRule="evenodd" d="M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z" clipRule="evenodd" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
@ -225,7 +225,6 @@ function Item({ item, idx, listId }: ItemProps) {
|
|||||||
const { clickedItem, setClickedItem, itemDragTarget, setItemDragTarget } =
|
const { clickedItem, setClickedItem, itemDragTarget, setItemDragTarget } =
|
||||||
useGlobal()
|
useGlobal()
|
||||||
const {
|
const {
|
||||||
// @ts-ignore
|
|
||||||
value: { tags, itemTags },
|
value: { tags, itemTags },
|
||||||
removeItemTag
|
removeItemTag
|
||||||
} = useBoardTagsStore((state) => [
|
} = useBoardTagsStore((state) => [
|
||||||
@ -234,11 +233,8 @@ function Item({ item, idx, listId }: ItemProps) {
|
|||||||
])
|
])
|
||||||
|
|
||||||
const itemItemTags: Array<Tag | undefined> = useMemo(() => {
|
const itemItemTags: Array<Tag | undefined> = useMemo(() => {
|
||||||
// @ts-ignore
|
|
||||||
const tagsForThisItem = itemTags.filter((it) => it.itemId === item.id)
|
const tagsForThisItem = itemTags.filter((it) => it.itemId === item.id)
|
||||||
// @ts-ignore
|
|
||||||
const mappedTags = tagsForThisItem.map((it) => {
|
const mappedTags = tagsForThisItem.map((it) => {
|
||||||
// @ts-ignore
|
|
||||||
const foundTag = tags.find((t) => t.id === it.tagId)
|
const foundTag = tags.find((t) => t.id === it.tagId)
|
||||||
if (!foundTag) {
|
if (!foundTag) {
|
||||||
void removeItemTag(it)
|
void removeItemTag(it)
|
||||||
|
@ -9,12 +9,17 @@ import { loadBoards } from "../idb"
|
|||||||
|
|
||||||
export function GlobalProvider({ children }: { children?: JSX.Element[] }) {
|
export function GlobalProvider({ children }: { children?: JSX.Element[] }) {
|
||||||
const [state, dispatch] = useReducer(globalStateReducer, defaultGlobalState)
|
const [state, dispatch] = useReducer(globalStateReducer, defaultGlobalState)
|
||||||
useEffect(() => {
|
|
||||||
;(async () => {
|
async function _loadBoards() {
|
||||||
const boards = await loadBoards()
|
const boards = await loadBoards()
|
||||||
dispatch({ type: "SET_BOARDS", payload: boards })
|
dispatch({ type: "SET_BOARDS", payload: boards })
|
||||||
})()
|
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
_loadBoards()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GlobalCtx.Provider value={state}>
|
<GlobalCtx.Provider value={state}>
|
||||||
<GlobalDispatchCtx.Provider value={dispatch}>
|
<GlobalDispatchCtx.Provider value={dispatch}>
|
||||||
|
@ -10,10 +10,8 @@ import {
|
|||||||
} from "../types"
|
} from "../types"
|
||||||
import { addBoard as addBoardDb } from "../idb"
|
import { addBoard as addBoardDb } from "../idb"
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
export const GlobalCtx = createContext<GlobalState>(null)
|
export const GlobalCtx = createContext<GlobalState>(null)
|
||||||
export const GlobalDispatchCtx =
|
export const GlobalDispatchCtx =
|
||||||
// @ts-ignore
|
|
||||||
createContext<(action: GlobalDispatchAction) => void>(null)
|
createContext<(action: GlobalDispatchAction) => void>(null)
|
||||||
|
|
||||||
export function useGlobal() {
|
export function useGlobal() {
|
||||||
|
@ -6,6 +6,5 @@ type MouseContext = {
|
|||||||
setValue: (payload: Vector2) => void
|
setValue: (payload: Vector2) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
export const MouseCtx = createContext<MouseContext>(null)
|
export const MouseCtx = createContext<MouseContext>(null)
|
||||||
export const useMouse = () => useContext(MouseCtx)
|
export const useMouse = () => useContext(MouseCtx)
|
||||||
|
Loading…
Reference in New Issue
Block a user