Remove Svelte upgrade compatibility code
This commit is contained in:
1 parent
1956790dde
commit
672a19f8f6
19 files changed
+105
-110
No files matched your search
@@ -1,14 +1,11 @@
|
||||
<script lang="ts">
|
||||
import type { FSNode } from 'lib/FilesystemAPI.svelte';
|
||||
import { run } from 'svelte/legacy';
|
||||
|
||||
let { path = [] }: {path: FSNode[]} = $props();
|
||||
|
||||
let image_uri: string = $state()
|
||||
let image_link: string = $state()
|
||||
const update_links = (path: FSNode[]) => {
|
||||
image_uri = null
|
||||
image_link = null
|
||||
let { image_uri, image_link } = $derived.by(() => {
|
||||
let image_uri: string = null
|
||||
let image_link: string = null
|
||||
for (let node of path) {
|
||||
if (node.properties && node.properties.branding_enabled === "true") {
|
||||
if (node.properties.brand_header_image) {
|
||||
@@ -19,10 +16,8 @@ const update_links = (path: FSNode[]) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
run(() => {
|
||||
update_links(path)
|
||||
});
|
||||
return { image_uri, image_link }
|
||||
})
|
||||
</script>
|
||||
|
||||
{#if image_uri}
|
||||
|
||||
@@ -48,19 +48,22 @@ export const update = async () => {
|
||||
return
|
||||
}
|
||||
|
||||
zip = await resp.json() as ZipEntry
|
||||
const z = await resp.json() as ZipEntry
|
||||
|
||||
// Check if the zip has the property which allows separate files to be
|
||||
// downloaded. If so then we set the download URL for each file
|
||||
if (zip.properties !== undefined) {
|
||||
if (zip.properties.includes("read_individual_files")) {
|
||||
// downloaded. If so then we set the download URL for each file. This
|
||||
// happens before the zip becomes state, else every file in the archive
|
||||
// would get a state proxy instead of only the ones which are rendered
|
||||
if (z.properties !== undefined) {
|
||||
if (z.properties.includes("read_individual_files")) {
|
||||
// Set the download URL for each file in the zip
|
||||
recursive_set_url(fs_path_url(node.path)+"?zip_file=", zip)
|
||||
recursive_set_url(fs_path_url(node.path)+"?zip_file=", z)
|
||||
}
|
||||
truncated = zip.properties.includes("truncated")
|
||||
truncated = z.properties.includes("truncated")
|
||||
}
|
||||
|
||||
uncomp_size = recursive_size(zip)
|
||||
uncomp_size = recursive_size(z)
|
||||
zip = z
|
||||
comp_ratio = (uncomp_size / node.file_size)
|
||||
status = "finished"
|
||||
} catch (err) {
|
||||
|
||||
Reference in new issue
Block a user