-
Notifications
You must be signed in to change notification settings - Fork 8.6k
FEATURE: Add experimental plugin API to register messages nav dropdown #19294
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
FEATURE: Add experimental plugin API to register messages nav dropdown #19294
Conversation
This commit also removes the `user-messages-nav` plugin outlet without deprecation in the redesigned user page navigation.
@lis2 Can you review this for me? Thank you! |
} | ||
|
||
export function resetCustomUserNavMessagesDropdownRows() { | ||
customUserNavMessagesDropdownRows.length = 0; |
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.
This is interesting way to reset. Is there a benefit of this approach over = []
?
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.
Setting .length = 0
clears the original array whereas = []
is setting the variable to another array. If there is a spot in the code that has already referenced this constant, using = []
will actually not work properly.
return this.router.urlFor(parentRoute.name, this.model.username); | ||
let value; | ||
|
||
for (let i = this.messagesDropdownContent.length - 1; i >= 0; i--) { |
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 guess you used for loop to have access to value
. Maybe it would better to use forEach but with old way function. Something like
this.messagesDropdownContent.forEach(function(content) {
})
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 actually looping in reverse here which is why I can't use forEach
.
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.
Thank you for clarifying :)
Thank you for reviewing @lis2 |
This commit also removes the
user-messages-nav
plugin outlet withoutdeprecation in the redesigned user page navigation.