mirror of
https://github.com/nasa/openmct.git
synced 2025-01-02 03:16:41 +00:00
fix(restrictedNotebook): fix issue causing snapshots to not be able to be deleted from a locked page
- Using `this.$delete(arr, index)` does not update the `length` property on the underlying target object, so it can lead to bizarre issues where your array is of length 4 but it has 3 objects in it.
This commit is contained in:
parent
c1d1b03b23
commit
76c37ff410
@ -106,9 +106,8 @@ export default {
|
||||
watch: {
|
||||
isLocked(value) {
|
||||
if (value === true) {
|
||||
let index = this.menuActions.findIndex((item) => item.id === 'removeEmbed');
|
||||
|
||||
this.$delete(this.menuActions, index);
|
||||
const index = this.menuActions.findIndex((item) => item.id === 'removeEmbed');
|
||||
this.menuActions.splice(index, 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -140,7 +139,7 @@ export default {
|
||||
onItemClicked: () => this.openSnapshot()
|
||||
};
|
||||
|
||||
this.menuActions = [viewSnapshot];
|
||||
this.menuActions.splice(0, this.menuActions.length, viewSnapshot);
|
||||
}
|
||||
|
||||
const navigateToItem = {
|
||||
@ -167,7 +166,7 @@ export default {
|
||||
onItemClicked: () => this.previewEmbed()
|
||||
};
|
||||
|
||||
this.menuActions = this.menuActions.concat([quickView, navigateToItem, navigateToItemInTime]);
|
||||
this.menuActions.push(...[quickView, navigateToItem, navigateToItemInTime]);
|
||||
|
||||
if (!this.isLocked) {
|
||||
const removeEmbed = {
|
||||
|
Loading…
Reference in New Issue
Block a user