From 7d3a5787307d118577e179ddae948989499f8db3 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Fri, 17 Oct 2025 17:59:33 -0400 Subject: [PATCH] fix updating pub theme --- app/lish/[did]/[publication]/dashboard/page.tsx | 2 +- components/ThemeManager/PubThemeSetter.tsx | 7 +++++-- components/ThemeManager/PublicationThemeProvider.tsx | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/lish/[did]/[publication]/dashboard/page.tsx b/app/lish/[did]/[publication]/dashboard/page.tsx index a51061e9..d124fe8e 100644 --- a/app/lish/[did]/[publication]/dashboard/page.tsx +++ b/app/lish/[did]/[publication]/dashboard/page.tsx @@ -69,7 +69,7 @@ export default async function Publication(props: { publication_rkey={uri.rkey} publication_data={publication_data} > - + diff --git a/components/ThemeManager/PubThemeSetter.tsx b/components/ThemeManager/PubThemeSetter.tsx index db4e1d67..bc022d99 100644 --- a/components/ThemeManager/PubThemeSetter.tsx +++ b/components/ThemeManager/PubThemeSetter.tsx @@ -79,8 +79,11 @@ export const PubThemeSetter = () => { }, }); mutate((pub) => { - if (result?.publication && pub) - return { ...pub, record: result.publication.record }; + if (result?.publication && pub?.publication) + return { + ...pub, + publication: { ...pub.publication, ...result.publication }, + }; return pub; }, false); setLoading(false); diff --git a/components/ThemeManager/PublicationThemeProvider.tsx b/components/ThemeManager/PublicationThemeProvider.tsx index 3b374f7e..cb593333 100644 --- a/components/ThemeManager/PublicationThemeProvider.tsx +++ b/components/ThemeManager/PublicationThemeProvider.tsx @@ -47,7 +47,6 @@ let isColor = ( export function PublicationThemeProviderDashboard(props: { children: React.ReactNode; - record?: PubLeafletPublication.Record | null; }) { let { data } = usePublicationData(); let { publication: pub } = data || {}; -- 2.51.2