This commit is contained in:
+3
-1
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, nextTick, onMounted, onUnmounted, reactive, ref, shallowRef, watch } from "vue";
|
import { computed, nextTick, onMounted, onUnmounted, reactive, ref, shallowRef, watch } from "vue";
|
||||||
import { invoke } from "@tauri-apps/api/core";
|
import { invoke } from "@tauri-apps/api/core";
|
||||||
|
import { homeDir } from "@tauri-apps/api/path";
|
||||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||||
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
|
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
|
||||||
import { open as openDialog } from "@tauri-apps/plugin-dialog";
|
import { open as openDialog } from "@tauri-apps/plugin-dialog";
|
||||||
@@ -119,7 +120,8 @@ async function openRepo(path: string) {
|
|||||||
|
|
||||||
async function browse() {
|
async function browse() {
|
||||||
menuOpen.value = false;
|
menuOpen.value = false;
|
||||||
const path = await openDialog({ directory: true, title: "Open a git repository" }).catch(() => null);
|
const home = await homeDir().catch(() => undefined);
|
||||||
|
const path = await openDialog({ directory: true, title: "Open a git repository", defaultPath: home }).catch(() => null);
|
||||||
if (typeof path === "string") await openRepo(path);
|
if (typeof path === "string") await openRepo(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user