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:
Jesse Mazzella 2023-07-21 14:18:24 -07:00
parent c1d1b03b23
commit 76c37ff410

View File

@ -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 = {