mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:13:51 +01:00
Fix import order for nested folders to prevent foreign key constraint error
This commit is contained in:
@@ -17,14 +17,13 @@ const rtlEscapeChar = <>‎</>;
|
||||
|
||||
export function SelectFile({ onChange, filePath, inline, className }: Props) {
|
||||
const handleClick = async () => {
|
||||
const selected = await open({
|
||||
const filePath = await open({
|
||||
title: 'Select File',
|
||||
multiple: false,
|
||||
});
|
||||
if (selected == null) return;
|
||||
if (filePath == null) return;
|
||||
|
||||
const filePath = selected.path;
|
||||
const contentType = typeof filePath === 'string' && filePath ? mime.getType(filePath) : null;
|
||||
const contentType = filePath ? mime.getType(filePath) : null;
|
||||
onChange({ filePath, contentType });
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user