-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove jQuery AJAX from the diff functions #29743
Conversation
- Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the review conversation comment, resolve, unresolve, show more files, and load diff functionality and it works as before Signed-off-by: Yarden Shoham <[email protected]>
}).fail(() => { | ||
} catch (error) { | ||
console.error('Error:', error); | ||
} finally { | ||
$target.removeClass('disabled'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, fail
?
Interesting, this code was even more wrong than expected…
Co-authored-by: silverwind <[email protected]>
web_src/js/features/repo-diff.js
Outdated
if (!resp) { | ||
$target.removeClass('disabled'); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!resp) { | |
$target.removeClass('disabled'); | |
return; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because finally has done that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove only $target.removeClass('disabled');
? To not continue if resp
is falsy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done f7691ae
* giteaofficial/main: Update JS dependences (go-gitea#29797) Unify search boxes (go-gitea#29530) Fix document error about 'make trans-copy' (go-gitea#29710) Remove jQuery AJAX from the diff functions (go-gitea#29743) Fix Safari spinner rendering (go-gitea#29801) Remove jQuery AJAX from the `repo-issue.js` file (go-gitea#29776) Improve commit record's ui in comment list (go-gitea#26619) enable tailwind nesting (go-gitea#29746)
Demo using
fetch
instead of jQuery AJAX