Skip to content

Commit

Permalink
show modal on new instance being downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamby777 committed Jun 3, 2024
1 parent 0c55b09 commit 8be2993
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ async function createInstance() {

const version = releases[newinstVerE.selectedIndex];

// show modal so the user knows it's working
openModal("Creating Instance", "Please wait...", []);

await invoke("create_instance", {
name,
version,
});

closeModal();

await repopulateInstanceRow();
}

Expand Down Expand Up @@ -165,6 +170,12 @@ interface ModalButtons {
onclick: () => void;
}

function closeModal() {
const modal = document.querySelector("#modal-bg") as HTMLDivElement;
modal.style.display = "none";
modal.remove();
}

function openModal(title: string, message: string, buttons: ModalButtons[]) {
const cloned = cloneTemplate("#modal-template");
document.body.prepend(cloned);
Expand Down

0 comments on commit 8be2993

Please sign in to comment.