mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Bugfix: when Nextcloud calendar is cancelled, don't try to save #569
This commit is contained in:
parent
63d693f21b
commit
a1cafb1d0c
1 changed files with 10 additions and 9 deletions
|
|
@ -70,15 +70,16 @@
|
|||
view.nextcloudSaveICS = () => {
|
||||
let attachment = view.nextcloudICS();
|
||||
attachment && rl.nextcloud.selectCalendar().then(href => {
|
||||
console.dir({href: href});
|
||||
fetch(attachment.linkDownload(), {
|
||||
mode: 'same-origin',
|
||||
cache: 'no-cache',
|
||||
redirect: 'error',
|
||||
credentials: 'same-origin'
|
||||
})
|
||||
.then(response => (response.status < 400) ? response.text() : Promise.reject(new Error({ response })))
|
||||
.then(text => rl.nextcloud.calendarPut(href, text));
|
||||
if (href) {
|
||||
fetch(attachment.linkDownload(), {
|
||||
mode: 'same-origin',
|
||||
cache: 'no-cache',
|
||||
redirect: 'error',
|
||||
credentials: 'same-origin'
|
||||
})
|
||||
.then(response => (response.status < 400) ? response.text() : Promise.reject(new Error({ response })))
|
||||
.then(text => rl.nextcloud.calendarPut(href, text));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue