mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-02 07:53:55 +03:00
set default path to homedir
This commit is contained in:
parent
5126259f5f
commit
e24ebcdbab
@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import '../styles/main.postcss';
|
import '../styles/main.postcss';
|
||||||
|
|
||||||
|
import { homeDir } from '@tauri-apps/api/path';
|
||||||
import { open } from '@tauri-apps/api/dialog';
|
import { open } from '@tauri-apps/api/dialog';
|
||||||
import * as toasts from '$lib/utils/toasts';
|
import * as toasts from '$lib/utils/toasts';
|
||||||
import * as hotkeys from '$lib/utils/hotkeys';
|
import * as hotkeys from '$lib/utils/hotkeys';
|
||||||
@ -33,8 +34,8 @@
|
|||||||
|
|
||||||
onMount(() =>
|
onMount(() =>
|
||||||
unsubscribe(
|
unsubscribe(
|
||||||
events.on('openNewProjectModal', () =>
|
events.on('openNewProjectModal', async () =>
|
||||||
open({ directory: true, recursive: true })
|
open({ directory: true, recursive: true, defaultPath: await homeDir() })
|
||||||
.then((selectedPath) => {
|
.then((selectedPath) => {
|
||||||
if (selectedPath === null) return;
|
if (selectedPath === null) return;
|
||||||
if (Array.isArray(selectedPath) && selectedPath.length !== 1) return;
|
if (Array.isArray(selectedPath) && selectedPath.length !== 1) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user