Skip to content

Commit 38c5945

Browse files
committed
Making sure loading state is ended in case of an exception
Addresses #37 (comment) Signed-off-by: Kaur Palang <kaur.palang@brightcodecompany.com>
1 parent 06c3cee commit 38c5945

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

app/pages/index.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@ const launchServer = async () => {
3030
3131
// FIXME This is a nasty hack to get the loading icon
3232
setTimeout(async () => {
33-
const response: string = await invoke('launch', {id: connectionToLaunch.value!!.id})
34-
const result: any = JSON.parse(response)
35-
36-
if (result.code === 1) {
33+
try {
34+
const response: string = await invoke('launch', {id: connectionToLaunch.value!!.id})
35+
const result: any = JSON.parse(response)
36+
37+
if (result.code === 1) {
38+
isLoading.value = false
39+
cert.value = result.cert
40+
}
41+
} finally {
3742
isLoading.value = false
38-
cert.value = result.cert
3943
}
40-
41-
isLoading.value = false
4244
}, 100)
4345
}
4446

0 commit comments

Comments
 (0)