(theme: CustomTheme)
| 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({ |
no test coverage detected