diff options
-rw-r--r-- | FrontEnd/src/components/Spinner.tsx | 2 | ||||
-rw-r--r-- | FrontEnd/src/components/hooks/useAutoUnsubscribePromise.ts (renamed from FrontEnd/src/components/hooks/useAutoUnsubscribePromise.tsx) | 3 | ||||
-rw-r--r-- | FrontEnd/src/components/hooks/useWindowLeave.ts | 2 | ||||
-rw-r--r-- | FrontEnd/src/pages/timeline/edit/MarkdownPostEdit.tsx | 17 | ||||
-rw-r--r-- | FrontEnd/src/pages/timeline/view/MarkdownPostView.tsx | 3 | ||||
-rw-r--r-- | FrontEnd/src/services/alert.ts | 2 |
6 files changed, 13 insertions, 16 deletions
diff --git a/FrontEnd/src/components/Spinner.tsx b/FrontEnd/src/components/Spinner.tsx index 2752a519..50ccf0b2 100644 --- a/FrontEnd/src/components/Spinner.tsx +++ b/FrontEnd/src/components/Spinner.tsx @@ -23,7 +23,7 @@ function calculateSize(size: SpinnerProps["size"]) { } export interface SpinnerProps extends ComponentPropsWithoutRef<"span"> { - size?: "sm" | "md" | "lg" | number | string; + size?: number | string; className?: string; style?: CSSProperties; } diff --git a/FrontEnd/src/components/hooks/useAutoUnsubscribePromise.tsx b/FrontEnd/src/components/hooks/useAutoUnsubscribePromise.ts index 78e21151..01c5a1db 100644 --- a/FrontEnd/src/components/hooks/useAutoUnsubscribePromise.tsx +++ b/FrontEnd/src/components/hooks/useAutoUnsubscribePromise.ts @@ -19,5 +19,6 @@ export default function useAutoUnsubscribePromise<T>( subscribe = false; }; } - }, dependencies); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [promiseGenerator, resultHandler, ...(dependencies ?? [])]); } diff --git a/FrontEnd/src/components/hooks/useWindowLeave.ts b/FrontEnd/src/components/hooks/useWindowLeave.ts index 08777e30..ecd999d4 100644 --- a/FrontEnd/src/components/hooks/useWindowLeave.ts +++ b/FrontEnd/src/components/hooks/useWindowLeave.ts @@ -18,5 +18,5 @@ export default function useWindowLeave( window.onbeforeunload = null; }; } - }, [allow, message]); + }, [c, allow, message]); } diff --git a/FrontEnd/src/pages/timeline/edit/MarkdownPostEdit.tsx b/FrontEnd/src/pages/timeline/edit/MarkdownPostEdit.tsx index 692221fd..36a5572b 100644 --- a/FrontEnd/src/pages/timeline/edit/MarkdownPostEdit.tsx +++ b/FrontEnd/src/pages/timeline/edit/MarkdownPostEdit.tsx @@ -19,24 +19,21 @@ class MarkedRenderer extends marked.Renderer { } // Custom image parser for indexed image link. - image(href: string | null, title: string | null, text: string): string { - if (href != null) { - const i = parseInt(href); - if (!isNaN(i) && i > 0 && i <= this.images.length) { - href = this.images[i - 1]; - } + image(href: string, title: string | null, text: string): string { + const i = parseInt(href); + if (!isNaN(i) && i > 0 && i <= this.images.length) { + href = this.images[i - 1]; } return super.image(href, title, text); } } -function generateMarkedOptions(imageUrls: string[]): marked.MarkedOptions { +function generateMarkedOptions(imageUrls: string[]) { return { - mangle: false, - headerIds: false, renderer: new MarkedRenderer(imageUrls), - }; + async: false, + } as const; } function renderHtml(text: string, imageUrls: string[]): string { diff --git a/FrontEnd/src/pages/timeline/view/MarkdownPostView.tsx b/FrontEnd/src/pages/timeline/view/MarkdownPostView.tsx index caf6eef0..9bb9f980 100644 --- a/FrontEnd/src/pages/timeline/view/MarkdownPostView.tsx +++ b/FrontEnd/src/pages/timeline/view/MarkdownPostView.tsx @@ -40,8 +40,7 @@ export default function MarkdownPostView({ const markdownHtml = useMemo<string | null>(() => { if (markdown == null) return null; return marked.parse(markdown, { - mangle: false, - headerIds: false, + async: false, }); }, [markdown]); diff --git a/FrontEnd/src/services/alert.ts b/FrontEnd/src/services/alert.ts index 241deab1..0fa37848 100644 --- a/FrontEnd/src/services/alert.ts +++ b/FrontEnd/src/services/alert.ts @@ -1,7 +1,7 @@ import pull from "lodash/pull"; import { I18nText } from "~src/common"; -import { ThemeColor } from "~src/views/common/common"; +import { ThemeColor } from "~src/components/common"; export interface AlertInfo { type?: ThemeColor; |