diff --git a/next-env.d.ts b/next-env.d.ts
index 534a39ea7..9bc3dd46b 100644
--- a/next-env.d.ts
+++ b/next-env.d.ts
@@ -1,6 +1,6 @@
-///
-///
-///
-
-// NOTE: This file should not be edited
-// see https://nextjs.org/docs/basic-features/typescript for more information.
+///
+///
+///
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information.
From 8b121fdca1af0feb71f0ab72ef5994c81ec88190 Mon Sep 17 00:00:00 2001
From: K0IN <19688162+K0IN@users.noreply.github.com>
Date: Wed, 24 Nov 2021 19:08:40 +0100
Subject: [PATCH 8/8] Fixed type issues
---
components/container/edit-container.tsx | 4 ++--
components/editor/editor.tsx | 8 ++++----
components/note-nav.tsx | 4 ++--
docker-compose.yml | 2 +-
libs/web/state/tree.ts | 2 +-
next-env.d.ts | 12 ++++++------
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/components/container/edit-container.tsx b/components/container/edit-container.tsx
index ea59ff908..63323dafb 100644
--- a/components/container/edit-container.tsx
+++ b/components/container/edit-container.tsx
@@ -1,7 +1,7 @@
import NoteState from 'libs/web/state/note'
import { has } from 'lodash'
import router, { useRouter } from 'next/router'
-import { RefObject, useCallback, useEffect, useRef, useState } from 'react'
+import { useCallback, useEffect, useRef, useState } from 'react'
import NoteTreeState from 'libs/web/state/tree'
import NoteNav from 'components/note-nav'
import UIState from 'libs/web/state/ui'
@@ -34,7 +34,7 @@ export const EditContainer = () => {
const isNew = has(query, 'new')
const { mutate: mutateSettings } = useSettingsAPI()
const toast = useToast()
- const saveRef = useRef<() => void>() as RefObject
+ const saveRef = useRef<() => void>()
const loadNoteById = useCallback(
async (id: string) => {
diff --git a/components/editor/editor.tsx b/components/editor/editor.tsx
index 92a290411..57a9ce755 100644
--- a/components/editor/editor.tsx
+++ b/components/editor/editor.tsx
@@ -1,4 +1,4 @@
-import { FC, Ref, useEffect, useState } from 'react'
+import { FC, MutableRefObject, useEffect, useState } from 'react'
import { use100vh } from 'react-div-100vh'
import MarkdownEditor, { Props } from 'rich-markdown-editor'
import { useEditorTheme } from './theme'
@@ -14,7 +14,7 @@ export interface EditorProps extends Pick
{
isPreview?: boolean
explicitSave?: boolean
saveState?: (state: boolean) => void
- saveRef?: Ref<() => void>
+ saveRef?: MutableRefObject<(() => void) | undefined>
}
const Editor: FC = ({
@@ -55,7 +55,7 @@ const Editor: FC = ({
saveState && saveState(true)
}
}
- if (saveRef) (saveRef as any).current = handleKeyDown
+ if (saveRef) (saveRef as MutableRefObject<() => void>).current = handleKeyDown
}, [saveState, saveRef, editorEl, onEditorChange])
return (
@@ -68,7 +68,7 @@ const Editor: FC = ({
onChange={
explicitSave ? () => saveState && saveState(false) : onEditorChange
}
- onSave={explicitSave ? () => (saveRef as any)?.current?.() : undefined}
+ onSave={explicitSave ? () => (saveRef as MutableRefObject<() => void>)?.current?.() : undefined}
placeholder={dictionary.editorPlaceholder}
theme={editorTheme}
uploadImage={(file) => onUploadImage(file, note?.id)}
diff --git a/components/note-nav.tsx b/components/note-nav.tsx
index 693ddc4ae..e79e4dc80 100644
--- a/components/note-nav.tsx
+++ b/components/note-nav.tsx
@@ -1,7 +1,7 @@
import classNames from 'classnames'
import NoteState from 'libs/web/state/note'
import UIState from 'libs/web/state/ui'
-import { useCallback, MouseEvent, RefObject } from 'react'
+import { useCallback, MouseEvent, MutableRefObject } from 'react'
import { CircularProgress, Tooltip } from '@material-ui/core'
import NoteTreeState from 'libs/web/state/tree'
import { Breadcrumbs } from '@material-ui/core'
@@ -36,7 +36,7 @@ const MenuButton = () => {
type Props = {
explicitSave?: boolean
isSaved?: boolean
- saveRef: RefObject<() => void>
+ saveRef?: MutableRefObject<(() => void) | undefined>
}
const NoteNav = ({ explicitSave, isSaved, saveRef }: Props) => {
diff --git a/docker-compose.yml b/docker-compose.yml
index 718c8b50f..7ee5eb7f3 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,7 +2,7 @@ version: '2'
services:
minio:
- image: minio/minio
+ image: minio/minio:RELEASE.2020-11-12T22-33-34Z
ports:
- '9000:9000'
environment:
diff --git a/libs/web/state/tree.ts b/libs/web/state/tree.ts
index 348f9f4e6..472b93863 100644
--- a/libs/web/state/tree.ts
+++ b/libs/web/state/tree.ts
@@ -163,7 +163,7 @@ const useNoteTree = (initData: TreeModel = DEFAULT_TREE) => {
const getPaths = useCallback((note: NoteModel) => {
const tree = treeRef.current
- return findParentTreeItems(tree, note).map((listItem) => listItem.data)
+ return findParentTreeItems(tree, note).map((listItem) => listItem.data!)
}, [])
const setItemsExpandState = useCallback(
diff --git a/next-env.d.ts b/next-env.d.ts
index 9bc3dd46b..534a39ea7 100644
--- a/next-env.d.ts
+++ b/next-env.d.ts
@@ -1,6 +1,6 @@
-///
-///
-///
-
-// NOTE: This file should not be edited
-// see https://nextjs.org/docs/basic-features/typescript for more information.
+///
+///
+///
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information.