forked from akanyan/STARTLINER
fix: start blocking the gui
This commit is contained in:
@ -63,8 +63,13 @@ pub async fn startline(app: AppHandle, refresh: bool) -> Result<(), String> {
|
|||||||
log::debug!("{}", hash);
|
log::debug!("{}", hash);
|
||||||
p.line_up(hash, refresh, app.clone()).await
|
p.line_up(hash, refresh, app.clone()).await
|
||||||
.map_err(|e| format!("Lineup failed:\n{}", e))?;
|
.map_err(|e| format!("Lineup failed:\n{}", e))?;
|
||||||
p.start(app.clone()).await
|
let app_clone = app.clone();
|
||||||
.map_err(|e| format!("Startup failed:\n{}", e))?;
|
let p_clone = p.clone();
|
||||||
|
tauri::async_runtime::spawn(async move {
|
||||||
|
if let Err(e) = p_clone.start(app_clone).await {
|
||||||
|
log::error!("Startup failed:\n{}", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
|
@ -16,7 +16,6 @@ import StartButton from './StartButton.vue';
|
|||||||
import { invoke } from '../invoke';
|
import { invoke } from '../invoke';
|
||||||
import { useGeneralStore, usePkgStore, usePrfStore } from '../stores';
|
import { useGeneralStore, usePkgStore, usePrfStore } from '../stores';
|
||||||
import { Dirs } from '../types';
|
import { Dirs } from '../types';
|
||||||
import { listen } from '@tauri-apps/api/event';
|
|
||||||
|
|
||||||
const pkg = usePkgStore();
|
const pkg = usePkgStore();
|
||||||
const prf = usePrfStore();
|
const prf = usePrfStore();
|
||||||
@ -28,7 +27,6 @@ const currentTab: Ref<string | number> = ref(3);
|
|||||||
const pkgSearchTerm = ref('');
|
const pkgSearchTerm = ref('');
|
||||||
|
|
||||||
const isProfileDisabled = computed(() => prf.current === null);
|
const isProfileDisabled = computed(() => prf.current === null);
|
||||||
const isRunning = ref(false);
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
invoke('list_directories').then((d) => {
|
invoke('list_directories').then((d) => {
|
||||||
@ -56,16 +54,6 @@ onMounted(async () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
listen('launch-start', () => {
|
|
||||||
isRunning.value = true;
|
|
||||||
currentTab.value = 5;
|
|
||||||
});
|
|
||||||
|
|
||||||
listen('launch-end', () => {
|
|
||||||
isRunning.value = false;
|
|
||||||
currentTab.value = 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -78,28 +66,25 @@ listen('launch-end', () => {
|
|||||||
>
|
>
|
||||||
<div class="fixed w-full flex z-100">
|
<div class="fixed w-full flex z-100">
|
||||||
<TabList class="grow">
|
<TabList class="grow">
|
||||||
<Tab :value="3" :disabled="isRunning"
|
<Tab :value="3"
|
||||||
><div class="pi pi-question-circle"></div
|
><div class="pi pi-question-circle"></div
|
||||||
></Tab>
|
></Tab>
|
||||||
<Tab :disabled="isProfileDisabled || isRunning" :value="0"
|
<Tab :disabled="isProfileDisabled" :value="0"
|
||||||
><div class="pi pi-box"></div
|
><div class="pi pi-box"></div
|
||||||
></Tab>
|
></Tab>
|
||||||
<Tab v-if="prf.current?.meta.game === 'chunithm'" :disabled="isRunning" :value="4"
|
<Tab v-if="prf.current?.meta.game === 'chunithm'" :value="4"
|
||||||
><div class="pi pi-ticket"></div
|
><div class="pi pi-ticket"></div
|
||||||
></Tab>
|
></Tab>
|
||||||
<Tab
|
<Tab
|
||||||
v-if="pkg.networkStatus === 'online'"
|
v-if="pkg.networkStatus === 'online'"
|
||||||
:disabled="isProfileDisabled || isRunning"
|
:disabled="isProfileDisabled"
|
||||||
:value="1"
|
:value="1"
|
||||||
><div class="pi pi-download"></div
|
><div class="pi pi-download"></div
|
||||||
></Tab>
|
></Tab>
|
||||||
<Tab :disabled="isProfileDisabled || isRunning" :value="2"
|
<Tab :disabled="isProfileDisabled" :value="2"
|
||||||
><div class="pi pi-cog"></div
|
><div class="pi pi-cog"></div
|
||||||
></Tab>
|
></Tab>
|
||||||
|
|
||||||
<Tab :value="5" v-if="isRunning"
|
|
||||||
><div class="pi pi-sparkles"></div
|
|
||||||
></Tab>
|
|
||||||
<div class="grow"></div>
|
<div class="grow"></div>
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
<div class="flex" v-if="currentTab !== 3">
|
<div class="flex" v-if="currentTab !== 3">
|
||||||
@ -169,7 +154,6 @@ listen('launch-end', () => {
|
|||||||
CHUNITHM patches are not yet implemented.<br />Use
|
CHUNITHM patches are not yet implemented.<br />Use
|
||||||
<a href=https://patcher.two-torial.xyz/ target="_blank" style="text-decoration: underline;">patcher.two-torial.xyz</a>
|
<a href=https://patcher.two-torial.xyz/ target="_blank" style="text-decoration: underline;">patcher.two-torial.xyz</a>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel :value="5">Running!</TabPanel>
|
|
||||||
</TabPanels>
|
</TabPanels>
|
||||||
<div v-if="currentTab === 5 || currentTab === 3">
|
<div v-if="currentTab === 5 || currentTab === 3">
|
||||||
<img
|
<img
|
||||||
|
Reference in New Issue
Block a user