mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-25 18:49:11 +03:00
Improve layout and completions
- Remove `open` import and `onSelectProjectClick` function from `+layout.svelte` file [src/routes/+layout.svelte] - Remove the `open` import from the `+layout.svelte` file - Remove the `onSelectProjectClick` function from the `+layout.svelte` file
This commit is contained in:
parent
e04440abc4
commit
8a97206f81
@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import "../app.postcss";
|
||||
|
||||
import { open } from "@tauri-apps/api/dialog";
|
||||
import type { LayoutData } from "./$types";
|
||||
import { log } from "$lib";
|
||||
import { onMount } from "svelte";
|
||||
@ -16,24 +15,7 @@
|
||||
onMount(log.setup);
|
||||
|
||||
export let data: LayoutData;
|
||||
const { projects, user } = data;
|
||||
|
||||
const onSelectProjectClick = async () => {
|
||||
const selectedPath = await open({
|
||||
directory: true,
|
||||
recursive: true,
|
||||
});
|
||||
if (selectedPath === null) return;
|
||||
if (Array.isArray(selectedPath) && selectedPath.length !== 1) return;
|
||||
const projectPath = Array.isArray(selectedPath)
|
||||
? selectedPath[0]
|
||||
: selectedPath;
|
||||
|
||||
const projectExists = $projects.some((p) => p.path === projectPath);
|
||||
if (projectExists) return;
|
||||
|
||||
await projects.add({ path: projectPath });
|
||||
};
|
||||
const { user } = data;
|
||||
</script>
|
||||
|
||||
<header
|
||||
|
Loading…
Reference in New Issue
Block a user