minor refactors
This commit is contained in:
parent
5af8fee981
commit
6e41abdf46
2 changed files with 7 additions and 7 deletions
|
@ -77,6 +77,7 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
|||
const [active, setActive] = createSignal<string>();
|
||||
const [contents, setContents] = createSignal<Map<string, Map<string, string>>>(new Map());
|
||||
const [tree, setFiles] = createSignal<FolderEntry>(emptyFolder);
|
||||
const [prompt, setPrompt] = createSignal<PromptApi>();
|
||||
|
||||
const tab = createMemo(() => {
|
||||
const name = active();
|
||||
|
@ -180,8 +181,6 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
|||
})();
|
||||
});
|
||||
|
||||
const [prompt, setPrompt] = createSignal<PromptApi>();
|
||||
|
||||
const commands = {
|
||||
open: createCommand('open folder', async () => {
|
||||
const directory = await window.showDirectoryPicker({ mode: 'readwrite' });
|
||||
|
@ -298,8 +297,6 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
|||
}}>{file().name}</Context.Handle>;
|
||||
},
|
||||
] as const}</Tree>
|
||||
|
||||
<span>Total mutation: {mutations().length}</span>
|
||||
</Sidebar>
|
||||
|
||||
<Tabs active={setActive} onClose={commands.closeTab}>
|
||||
|
@ -322,6 +319,10 @@ const Content: Component<{ directory: FileSystemDirectoryHandle, api?: Setter<Gr
|
|||
const [rows, setRows] = createSignal<Map<string, Record<string, string>>>(new Map);
|
||||
const [api, setApi] = createSignal<GridApi>();
|
||||
|
||||
if (!isServer && !('showDirectoryPicker' in window)) {
|
||||
throw new Error('Unable to manage files');
|
||||
}
|
||||
|
||||
createEffect(() => {
|
||||
props.entries?.(entries());
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue