MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / removeCustomTheme

Function removeCustomTheme

packages/app-core/src/components/SettingsModal.tsx:797–816  ·  view source on GitHub ↗
(theme: CustomTheme)

Source from the content-addressed store, hash-verified

795 }
796
797 const removeCustomTheme = async (theme: CustomTheme): Promise<void> => {
798 const ok = await confirmApp({
799 title: `Remove “${theme.name}”?`,
800 description: `This deletes the “${theme.slug}” folder from your themes folder. You can add it back any time.`,
801 confirmLabel: 'Remove',
802 danger: true
803 })
804 if (!ok) return
805 // If the theme being removed is the active one, step back to a built-in
806 // first so the UI doesn't fall through to the default theme mid-delete.
807 if (customThemeSlugFromId(themeId) === theme.slug) {
808 setTheme({
809 id: effectiveMode === 'dark' ? 'apple-dark' : 'apple-light',
810 family: 'apple',
811 mode: themeMode
812 })
813 }
814 await window.zen.deleteCustomTheme?.(theme.slug)
815 refreshCustomThemes()
816 }
817
818 const createTheme = async (): Promise<void> => {
819 const name = await promptApp({

Callers 1

SettingsModalFunction · 0.85

Calls 4

confirmAppFunction · 0.90
customThemeSlugFromIdFunction · 0.90
refreshCustomThemesFunction · 0.90
deleteCustomThemeMethod · 0.80

Tested by

no test coverage detected