mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-16 16:47:21 +02:00
enhance(dialog): use MaterialAlertDialogBuilder (#3491)
* Fix example insets * Add app-region: drag * Use `Theme.Material3.DayNight.NoActionBar` * Re-generate some kotlin files * Use MaterialAlertDialogBuilder * Add change file * Revert back to margin-top: 0.5rem * Re-generate outdated gradle wrapper from #3039 * Move title bar to its own file * Fix cancel message
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
|
||||
async function openDialog() {
|
||||
try {
|
||||
var result = await open({
|
||||
const result = await open({
|
||||
title: "My wonderful open dialog",
|
||||
defaultPath,
|
||||
filters: filter
|
||||
@@ -74,9 +74,11 @@
|
||||
|
||||
if (Array.isArray(result)) {
|
||||
onMessage(result);
|
||||
} else if (result === null) {
|
||||
onMessage('user cancelled the selection')
|
||||
} else {
|
||||
var pathToRead = result;
|
||||
var isFile = pathToRead.match(/\S+\.\S+$/g);
|
||||
const pathToRead = result;
|
||||
const isFile = pathToRead.match(/\S+\.\S+$/g);
|
||||
|
||||
await readFile(pathToRead)
|
||||
.then(function (res) {
|
||||
@@ -89,7 +91,7 @@
|
||||
arrayBufferToBase64(
|
||||
new Uint8Array(res),
|
||||
function (base64) {
|
||||
var src = "data:image/png;base64," + base64;
|
||||
const src = "data:image/png;base64," + base64;
|
||||
insecureRenderHtml('<img src="' + src + '"></img>');
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user