Fork pd_web, remove everything we don't need

This commit is contained in:
2025-09-24 15:37:57 +02:00
parent 9dcdd94b3a
commit fd5cd0bfd1
415 changed files with 146269 additions and 120786 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import { createEventDispatcher } from "svelte";
import ThemePresets from "./ThemePresets.svelte";
import { fs_update, fs_node_type, type FSNode, type NodeOptions } from "filesystem/FilesystemAPI";
import { fs_update, fs_node_type, type FSNode, type NodeOptions, node_is_shared, type FSPermissions } from "filesystem/FilesystemAPI";
import CustomBanner from "filesystem/viewers/CustomBanner.svelte";
import HelpButton from "layout/HelpButton.svelte";
import FilePicker from "filesystem/filemanager/FilePicker.svelte";
@@ -32,8 +32,7 @@ const handle_picker = async (e: CustomEvent<FSNode[]>) => {
alert("Please select one file")
return
}
const f = e.detail[0]
let file_id = f.id
let f = e.detail[0]
if (fs_node_type(f) !== "image") {
alert("Please select an image file")
@@ -44,19 +43,21 @@ const handle_picker = async (e: CustomEvent<FSNode[]>) => {
}
// If this image is not public, it will be made public
if (file_id === undefined || file_id === "") {
if (!node_is_shared(f)) {
try {
let new_file = await fs_update(e.detail[0].path, {shared: true})
file_id = new_file.id
f = await fs_update(
e.detail[0].path,
{link_permissions: {read: true} as FSPermissions},
)
} catch (err) {
alert(err)
}
}
if (picking === "brand_header_image") {
options.brand_header_image = file_id
options.brand_header_image = f.id
} else if (picking === "brand_background_image") {
options.brand_background_image = file_id
options.brand_background_image = f.id
}
}