Remove some event dispatchers
This commit is contained in:
@@ -33,12 +33,12 @@ const pick_image = (type: string) => {
|
||||
picking = type
|
||||
picker.open(file.path)
|
||||
}
|
||||
const handle_picker = async (e: CustomEvent<FSNode[]>) => {
|
||||
if (e.detail.length !== 1) {
|
||||
const handle_picker = async (nodes: FSNode[]) => {
|
||||
if (nodes.length !== 1) {
|
||||
alert("Please select one file")
|
||||
return
|
||||
}
|
||||
let f = e.detail[0]
|
||||
let f = nodes[0]
|
||||
|
||||
if (fs_node_type(f) !== "image") {
|
||||
alert("Please select an image file")
|
||||
@@ -52,7 +52,7 @@ const handle_picker = async (e: CustomEvent<FSNode[]>) => {
|
||||
if (!f.is_shared()) {
|
||||
try {
|
||||
f = await fs_update(
|
||||
e.detail[0].path,
|
||||
nodes[0].path,
|
||||
{link_permissions: {read: true} as FSPermissions},
|
||||
)
|
||||
} catch (err) {
|
||||
@@ -186,7 +186,7 @@ run(() => {
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<FilePicker bind:this={picker} on:files={handle_picker}/>
|
||||
<FilePicker bind:this={picker} callback={handle_picker}/>
|
||||
|
||||
<style>
|
||||
input[type="color"] {
|
||||
|
||||
Reference in New Issue
Block a user