mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-13 23:24:40 +00:00
fix: theme store stuck on loading skeleton after fetch failures
Harden theme list fetching with normalized API responses, timeouts, retries, and a visible error state so the store no longer stays blank when messaging or payloads fail (common after extension updates without a SEQTA tab reload).
This commit is contained in:
@@ -10,14 +10,18 @@
|
||||
}>();
|
||||
let emblaApi = $state();
|
||||
|
||||
const options = { loop: true };
|
||||
const plugins = [
|
||||
Autoplay({
|
||||
delay: 5000,
|
||||
stopOnInteraction: false,
|
||||
stopOnMouseEnter: true,
|
||||
}),
|
||||
];
|
||||
const options = $derived({ loop: slides.length > 1 });
|
||||
const plugins = $derived(
|
||||
slides.length > 1
|
||||
? [
|
||||
Autoplay({
|
||||
delay: 5000,
|
||||
stopOnInteraction: false,
|
||||
stopOnMouseEnter: true,
|
||||
}),
|
||||
]
|
||||
: [],
|
||||
);
|
||||
|
||||
function onInit(event: CustomEvent) {
|
||||
emblaApi = event.detail;
|
||||
|
||||
@@ -21,9 +21,12 @@
|
||||
allStoreThemeRows?: Theme[];
|
||||
}>();
|
||||
|
||||
let filteredThemes = $derived(themes.filter((theme: Theme) =>
|
||||
theme.name.toLowerCase().includes(searchTerm.toLowerCase()) || theme.description.toLowerCase().includes(searchTerm.toLowerCase())
|
||||
));
|
||||
let filteredThemes = $derived(themes.filter((theme: Theme) => {
|
||||
const q = searchTerm.toLowerCase();
|
||||
const name = (theme.name ?? '').toLowerCase();
|
||||
const description = (theme.description ?? '').toLowerCase();
|
||||
return name.includes(q) || description.includes(q);
|
||||
}));
|
||||
</script>
|
||||
|
||||
<div class="relative" >
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
|
||||
$effect(() => {
|
||||
|
||||
if (displayTheme) {
|
||||
if (displayTheme && modalElement) {
|
||||
|
||||
animate(
|
||||
|
||||
|
||||
Reference in New Issue
Block a user