-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Labels
topic/uiChange the appearance of the Gitea UIChange the appearance of the Gitea UItype/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.
Description
This is an issue for discussion of frontend refactoring. @lafriks @silverwind
The code https://github.com/go-gitea/gitea/blob/main/web_src/js/features/repo-legacy.js#L350 works like this:
$(document).on('click', '.edit-content', async function (event) {
await createDropzone();
event.preventDefault();
});
// equal to
$(document).on('click', '.edit-content', function (event) {
return Promise.resolve(createDropzone).then(() => {
event.preventDefault();
});
});
The usage of async/await is incorrect. The preventDefault
won't have effect because the event has been processed synchronously before (when the listener returned).
So, that's why I insist to clean up most inconsistent await/async in the code base, only use them when it is necessary.
We should do our best to make everything work as expected.
lunny and delvh
Metadata
Metadata
Assignees
Labels
topic/uiChange the appearance of the Gitea UIChange the appearance of the Gitea UItype/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.