mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: initialize multiselect state in modal component
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
let reportType = '';
|
let reportType = '';
|
||||||
let reportInitialized = false;
|
let reportInitialized = false;
|
||||||
let reportLoading = false;
|
let reportLoading = false;
|
||||||
|
let multiselectInitialized = false;
|
||||||
let turnstileEl: HTMLDivElement | null = null;
|
let turnstileEl: HTMLDivElement | null = null;
|
||||||
let turnstileWidgetId: string | null = null;
|
let turnstileWidgetId: string | null = null;
|
||||||
|
|
||||||
@@ -85,6 +86,13 @@
|
|||||||
initializeReport();
|
initializeReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: if (show && mode === 'multiselect' && !multiselectInitialized) {
|
||||||
|
multiselectInitialized = true;
|
||||||
|
inputValue = Array.isArray(initialValue)
|
||||||
|
? JSON.parse(JSON.stringify(initialValue))
|
||||||
|
: [];
|
||||||
|
}
|
||||||
|
|
||||||
function resetModal() {
|
function resetModal() {
|
||||||
inputValue =
|
inputValue =
|
||||||
initialValue !== null
|
initialValue !== null
|
||||||
@@ -102,6 +110,7 @@
|
|||||||
reportType = '';
|
reportType = '';
|
||||||
reportInitialized = false;
|
reportInitialized = false;
|
||||||
reportLoading = false;
|
reportLoading = false;
|
||||||
|
multiselectInitialized = false;
|
||||||
if (turnstileWidgetId && typeof window !== 'undefined' && window.turnstile?.remove) {
|
if (turnstileWidgetId && typeof window !== 'undefined' && window.turnstile?.remove) {
|
||||||
window.turnstile.remove(turnstileWidgetId);
|
window.turnstile.remove(turnstileWidgetId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user