mirror of
https://github.com/imputnet/cobalt.git
synced 2026-01-20 11:58:14 +00:00
web: fix state_referenced_locally warnings with proper runes
This commit is contained in:
parent
c857054dcc
commit
728d225515
@ -22,13 +22,16 @@
|
|||||||
let imageLoaded = $state(false);
|
let imageLoaded = $state(false);
|
||||||
let hideSkeleton = $state(false);
|
let hideSkeleton = $state(false);
|
||||||
|
|
||||||
let validUrl = false;
|
const validUrl = $derived.by(() => {
|
||||||
try {
|
try {
|
||||||
new URL(item.url);
|
new URL(item.url);
|
||||||
validUrl = true;
|
return true;
|
||||||
} catch {}
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const isTunnel = validUrl && new URL(item.url).pathname === "/tunnel";
|
const isTunnel = $derived(validUrl && new URL(item.url).pathname === "/tunnel");
|
||||||
|
|
||||||
const loaded = () => {
|
const loaded = () => {
|
||||||
imageLoaded = true;
|
imageLoaded = true;
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
onImport,
|
onImport,
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
let selectorStringMultiple = maxFileNumber > 1 ? ".multiple" : "";
|
const selectorStringMultiple = $derived(maxFileNumber > 1 ? ".multiple" : "");
|
||||||
|
|
||||||
let fileInput: HTMLInputElement;
|
let fileInput: HTMLInputElement;
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
copyData = "",
|
copyData = "",
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
const sectionURL = `${page.url.origin}${page.url.pathname}#${sectionId}`;
|
const sectionURL = $derived(`${page.url.origin}${page.url.pathname}#${sectionId}`);
|
||||||
|
|
||||||
let copied = $state(false);
|
let copied = $state(false);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -8,7 +8,11 @@
|
|||||||
|
|
||||||
let { loading }: Props = $props();
|
let { loading }: Props = $props();
|
||||||
|
|
||||||
let animated = $state(loading);
|
let animated = $state(false);
|
||||||
|
|
||||||
|
$effect(() => {
|
||||||
|
animated = loading;
|
||||||
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
initial spinner state is equal to loading state,
|
initial spinner state is equal to loading state,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user