Improve waiting dialog

This commit is contained in:
syuilo
2020-10-18 10:11:34 +09:00
parent 85a0f696bc
commit 1df7abfbb9
8 changed files with 110 additions and 131 deletions

View File

@ -44,14 +44,7 @@ export default defineComponent({
},
methods: {
upload() {
return new Promise((ok) => {
const dialog = os.dialog({
type: 'waiting',
text: this.$t('uploading') + '...',
showOkButton: false,
showCancelButton: false,
cancelableByBgClick: false
});
const promise = new Promise((ok) => {
const canvas = this.hpml.canvases[this.value.canvasId];
canvas.toBlob(blob => {
const data = new FormData();
@ -67,11 +60,12 @@ export default defineComponent({
})
.then(response => response.json())
.then(f => {
dialog.close();
ok(f);
})
});
});
os.promiseDialog(promise);
return promise;
},
async post() {
this.posting = true;