Worked on update dialog
This commit is contained in:
parent
6b497d30cd
commit
fb7c632c2c
@ -11,7 +11,7 @@ edition = "2021"
|
||||
tauri-build = { version = "1", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "1", features = ["shell-open"] }
|
||||
tauri = { version = "1", features = [ "dialog-ask", "shell-open"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
suppaftp = { version = "6.0.1", features = ["native-tls"] }
|
||||
|
@ -14,6 +14,10 @@
|
||||
"shell": {
|
||||
"all": false,
|
||||
"open": true
|
||||
},
|
||||
"dialog": {
|
||||
"all": false,
|
||||
"ask": true
|
||||
}
|
||||
},
|
||||
"windows": [
|
||||
|
@ -1,5 +1,6 @@
|
||||
const { invoke } = window.__TAURI__.tauri;
|
||||
const { listen } = window.__TAURI__.event;
|
||||
const { ask } = window.__TAURI__.dialog;
|
||||
//import { listen } from '@tauri-apps/api';
|
||||
|
||||
let greetInputEl;
|
||||
@ -20,6 +21,10 @@ const download_finished = listen("download_finished", (event) => {
|
||||
document.getElementById("launchGame").disabled = false;
|
||||
});
|
||||
|
||||
const update_dialog = listen("update_dialog", (event) => {
|
||||
ask("Do you want to update?", {title: "Update Available", type: "Message"}).then((value) => { if (value) { invoke("update").then(window.close()); } });
|
||||
});
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
document.getElementById("launchGame").addEventListener("click", gameLaunch);
|
||||
@ -57,6 +62,7 @@ function addModpacks(modpacks) {
|
||||
dropdown.options.add(opt);
|
||||
}
|
||||
}
|
||||
|
||||
function gameLaunch() {
|
||||
var packId = document.getElementById("Modpacks");
|
||||
var selectedId = packId.value;
|
||||
|
Loading…
Reference in New Issue
Block a user