Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions nested/dialog-window.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ <h5>Are you sure to delete the screen shot</h3>
import { EVENT } from '/src/constant.ts';
import { invoke } from "@tauri-apps/api/tauri";

const window = WebviewWindow.getByLabel('main')
const dialogWindow = getCurrent()
const window = WebviewWindow.getByLabel('main');
const dialogWindow = getCurrent();
document.getElementById('yes').addEventListener('click', async function () {
try {
await window.emit(EVENT.PERMISSION, { 'permission': true })
await dialogWindow.hide()
await dialogWindow.setDecorations(false);
} catch (e) {
console.log('error while emitting', e);
}
Expand All @@ -73,6 +74,7 @@ <h5>Are you sure to delete the screen shot</h3>
try {
await window.emit(EVENT.PERMISSION, { 'permission': false })
await dialogWindow.hide()
await dialogWindow.setDecorations(false);
} catch (e) {
console.log('error while emitting', e);
}
Expand All @@ -81,6 +83,7 @@ <h5>Are you sure to delete the screen shot</h3>
dialogWindow.onCloseRequested(async (event) => {
await window.emit(EVENT.PERMISSION, { 'permission': false });
await dialogWindow.hide();
await dialogWindow.setDecorations(false);
event.stopPropogation();
})

Expand Down
Loading