From ca75ad67218fcff72ef505d9d3d13d31d498920e Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Sun, 16 Feb 2025 13:26:27 -0300 Subject: [PATCH] feat: improve theme import with dynamic author information --- .../settings/aparence/modals/import-theme-modal.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/pages/settings/aparence/modals/import-theme-modal.tsx b/src/renderer/src/pages/settings/aparence/modals/import-theme-modal.tsx index eba51d6f..b22809ff 100644 --- a/src/renderer/src/pages/settings/aparence/modals/import-theme-modal.tsx +++ b/src/renderer/src/pages/settings/aparence/modals/import-theme-modal.tsx @@ -5,7 +5,7 @@ import "./modals.scss"; import { Theme } from "@types"; import { injectCustomCss, removeCustomCss } from "@renderer/helpers"; import { useToast } from "@renderer/hooks"; - +import { UserProfile } from "@types"; interface ImportThemeModalProps { visible: boolean; onClose: () => void; @@ -24,13 +24,18 @@ export const ImportThemeModal = ({ const { t } = useTranslation("settings"); const { showSuccessToast, showErrorToast } = useToast(); + let author: UserProfile | null = null; + window.electron.getUser(authorCode).then((user) => { + author = user; + }); + const handleImportTheme = async () => { const theme: Theme = { id: crypto.randomUUID(), name: themeName, isActive: false, - author: authorCode, - authorName: "spectre", + author: author?.id, + authorName: author?.displayName, code: `https://hydrathemes.shop/themes/${themeName}.css`, createdAt: new Date(), updatedAt: new Date(),