mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
Replace missed $.ajax with window.fetch
This commit is contained in:
parent
dca0ff02ed
commit
134cb7d52a
2 changed files with 28 additions and 22 deletions
|
|
@ -1161,15 +1161,17 @@ export function changeTheme(value, themeTrigger = noop) {
|
|||
|
||||
themeTrigger(SaveSettingsStep.Animate);
|
||||
|
||||
if (__themeAjax && __themeAjax.abort) {
|
||||
if (__themeAjax) {
|
||||
__themeAjax.abort();
|
||||
}
|
||||
|
||||
__themeAjax = $.ajax({
|
||||
url: url,
|
||||
dataType: 'json'
|
||||
})
|
||||
.then((data) => {
|
||||
let init = {};
|
||||
if (window.AbortController) {
|
||||
__themeAjax = new window.AbortController();
|
||||
init.signal = __themeAjax.signal;
|
||||
}
|
||||
window.fetch(url, init)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data && isArray(data) && 2 === data.length) {
|
||||
if (themeLink && themeLink[0] && (!themeStyle || !themeStyle[0])) {
|
||||
themeStyle = $('<style id="app-theme-style"></style>');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue