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

@@ -69,31 +69,15 @@ export default defineComponent({
data.append('file', file);
data.append('i', this.$store.state.i.token);
const dialog = os.dialog({
type: 'waiting',
text: this.$t('uploading') + '...',
showOkButton: false,
showCancelButton: false,
cancelableByBgClick: false
});
fetch(apiUrl + '/drive/files/create', {
const promise = fetch(apiUrl + '/drive/files/create', {
method: 'POST',
body: data
})
.then(response => response.json())
.then(f => {
this.reqImport(f);
})
.catch(e => {
os.dialog({
type: 'error',
text: e
});
})
.finally(() => {
dialog.close();
});
os.promiseDialog(promise);
},
reqImport(file) {