From 323fbc942299bf00898cce148fcae365d07a7222 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 26 Aug 2023 01:02:43 +0100 Subject: [PATCH] fix: editor auto fill --- src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx | 1 + src/app/dashboard/[subdomain]/editor/post-editor.tsx | 1 + src/app/dashboard/[subdomain]/editor/short-editor.tsx | 1 + src/models/page.model.ts | 2 ++ src/queries/page.ts | 1 + 5 files changed, 6 insertions(+) diff --git a/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx b/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx index 6695a517..d9f5a1d6 100644 --- a/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx +++ b/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx @@ -83,6 +83,7 @@ export default function PortfolioEditor() { noteId: pageId && /\d+/.test(pageId) ? +pageId : undefined, slug: pageId || draftKey.replace(`draft-${site.data?.characterId}-`, ""), handle: subdomain, + disableAutofill: true, }) const [visibility, setVisibility] = useState() diff --git a/src/app/dashboard/[subdomain]/editor/post-editor.tsx b/src/app/dashboard/[subdomain]/editor/post-editor.tsx index c2709971..2c9f3cb0 100644 --- a/src/app/dashboard/[subdomain]/editor/post-editor.tsx +++ b/src/app/dashboard/[subdomain]/editor/post-editor.tsx @@ -106,6 +106,7 @@ export default function PostEditor() { noteId: pageId && /\d+/.test(pageId) ? +pageId : undefined, slug: pageId || draftKey.replace(`draft-${site.data?.characterId}-`, ""), handle: subdomain, + disableAutofill: true, }) const [visibility, setVisibility] = useState() diff --git a/src/app/dashboard/[subdomain]/editor/short-editor.tsx b/src/app/dashboard/[subdomain]/editor/short-editor.tsx index 50c3649e..ab8d5a10 100644 --- a/src/app/dashboard/[subdomain]/editor/short-editor.tsx +++ b/src/app/dashboard/[subdomain]/editor/short-editor.tsx @@ -81,6 +81,7 @@ export default function ShortEditor() { noteId: pageId && /\d+/.test(pageId) ? +pageId : undefined, slug: pageId || draftKey.replace(`draft-${site.data?.characterId}-`, ""), handle: subdomain, + disableAutofill: true, }) const [visibility, setVisibility] = useState() diff --git a/src/models/page.model.ts b/src/models/page.model.ts index 05195230..5d12b23b 100644 --- a/src/models/page.model.ts +++ b/src/models/page.model.ts @@ -409,6 +409,7 @@ export async function getPage(input: { useStat?: boolean noteId?: number handle?: string // In order to be compatible with old drafts + disableAutofill?: boolean }) { const mustLocal = input.slug?.startsWith("!local-") && !input.noteId @@ -559,6 +560,7 @@ export async function getPage(input: { expandedNote = await expandCrossbellNote({ note: page, useStat: input.useStat, + disableAutofill: input.disableAutofill, }) } diff --git a/src/queries/page.ts b/src/queries/page.ts index f48e91ab..bff45685 100644 --- a/src/queries/page.ts +++ b/src/queries/page.ts @@ -93,6 +93,7 @@ export const useGetPage = ( noteId: input.noteId, useStat: input.useStat, handle: input.handle, + disableAutofill: input.disableAutofill, }) }) }