mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-13 07:04:39 +00:00
fix(CodeEditor): rerender code editor on edit
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
forceDark: undefined
|
forceDark: undefined
|
||||||
})
|
})
|
||||||
let closedAccordions = $state<string[]>([])
|
let closedAccordions = $state<string[]>([])
|
||||||
|
let themeLoaded = $state(false);
|
||||||
|
|
||||||
function toggleAccordion(title: string) {
|
function toggleAccordion(title: string) {
|
||||||
if (closedAccordions.includes(title)) {
|
if (closedAccordions.includes(title)) {
|
||||||
@@ -67,7 +68,12 @@
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tempTheme) theme = loadedTheme
|
if (tempTheme) {
|
||||||
|
theme = loadedTheme
|
||||||
|
themeLoaded = true // Set this to true after theme is loaded
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
themeLoaded = true // Set to true if no theme to load
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -172,7 +178,9 @@
|
|||||||
{:else if item.type === 'colourPicker'}
|
{:else if item.type === 'colourPicker'}
|
||||||
<ColourPicker savePresets={false} standalone={true} {...(item.props)} />
|
<ColourPicker savePresets={false} standalone={true} {...(item.props)} />
|
||||||
{:else if item.type === 'codeEditor'}
|
{:else if item.type === 'codeEditor'}
|
||||||
|
{#key themeLoaded}
|
||||||
<CodeEditor {...(item.props as CodeEditorProps)} />
|
<CodeEditor {...(item.props as CodeEditorProps)} />
|
||||||
|
{/key}
|
||||||
{:else if item.type === 'imageUpload'}
|
{:else if item.type === 'imageUpload'}
|
||||||
{#each theme.CustomImages as image (image.id)}
|
{#each theme.CustomImages as image (image.id)}
|
||||||
<div class="flex items-center h-16 gap-2 px-2 py-2 mb-4 bg-white rounded-lg shadow-lg dark:bg-zinc-700">
|
<div class="flex items-center h-16 gap-2 px-2 py-2 mb-4 bg-white rounded-lg shadow-lg dark:bg-zinc-700">
|
||||||
|
|||||||
Reference in New Issue
Block a user