Fix import order for nested folders to prevent foreign key constraint error

This commit is contained in:
Gregory Schier
2024-09-06 06:20:27 -07:00
parent fedf356576
commit 82252f920f
10 changed files with 387 additions and 235 deletions

View File

@@ -17,14 +17,13 @@ const rtlEscapeChar = <>&#x200E;</>;
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 });
};