mirror of https://github.com/status-im/consul.git
ui: Add an isDestroyed check for the MenuPanel component (#11104)
This solves an occasionally flakey tests I see every so often
This commit is contained in:
parent
e088d8674c
commit
ececa7da45
|
@ -12,14 +12,16 @@ export default Component.extend(Slotted, {
|
|||
actions: {
|
||||
connect: function($el) {
|
||||
next(() => {
|
||||
// if theres only a single choice in the menu and it doesn't have an
|
||||
// immediate button/link/label to click then it will be a
|
||||
// confirmation/informed action
|
||||
const isConfirmationMenu = this.dom.element(
|
||||
'li:only-child > [role="menu"]:first-child',
|
||||
$el
|
||||
);
|
||||
set(this, 'isConfirmation', typeof isConfirmationMenu !== 'undefined');
|
||||
if(!this.isDestroyed) {
|
||||
// if theres only a single choice in the menu and it doesn't have an
|
||||
// immediate button/link/label to click then it will be a
|
||||
// confirmation/informed action
|
||||
const isConfirmationMenu = this.dom.element(
|
||||
'li:only-child > [role="menu"]:first-child',
|
||||
$el
|
||||
);
|
||||
set(this, 'isConfirmation', typeof isConfirmationMenu !== 'undefined');
|
||||
}
|
||||
});
|
||||
},
|
||||
change: function(e) {
|
||||
|
|
Loading…
Reference in New Issue