-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
async dialog content => async create dialog #280
Conversation
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.
I'm not sure this works the way intended (or I read as intended)
src/code/sortable.js
Outdated
this._done = false; | ||
} | ||
); | ||
if (instantValues.length < promises.length) { |
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.
It's a style thing, but I'd invert the logic of this
if (IinstantValues.length == promises.length) {
...
return
}
...
and my comment from back in the day says I wanted to try allSettled, did you look into 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.
It's a style thing, but I'd invert the logic of this
fine
and my comment from back in the day says I wanted to try allSettled, did you look into that?
no, while it's not fail safe, the point of failure are to be defined first (include how to settle them)
atm, if one row fails, the issue is not only the rendering of the row but login/perm/team
@@ -27,6 +27,8 @@ const MarkerList = OperationChecklistDialog.extend({ | |||
this.closeDialog(); | |||
}; | |||
|
|||
await this.sortable.done; |
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 is a getter, which isn't async. does this work?
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 returns _done that is either a promise or boolean
also, you can always await a constant expression
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.
I'd forgotten that _done is ever a promise.
Promise.all is async even if all promises are already fulfilled
@@ -27,6 +27,8 @@ const MarkerList = OperationChecklistDialog.extend({ | |||
this.closeDialog(); | |||
}; | |||
|
|||
await this.sortable.done; |
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.
I'd forgotten that _done is ever a promise.
Wait for dialog content before showing the dialog
This allows jquery/iitc dialog to place the dialog in the center of the screen with respect to the content on opening.
Additionally, don't use Promise.all when all promises are already fulfilled (synchronously)