fix preview by checking before accessing key, fix delay of resize, by using leading:true option of debounce (#5054)

This commit is contained in:
Jamie V 2022-04-19 11:34:26 -07:00 committed by GitHub
parent a3c0e073c8
commit 91bcd78d40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -536,7 +536,7 @@ export default {
this.updateRelatedTelemetryForFocusedImage = _.debounce(this.updateRelatedTelemetryForFocusedImage, 400);
// for resizing the object view
this.resizeImageContainer = _.debounce(this.resizeImageContainer, 400);
this.resizeImageContainer = _.debounce(this.resizeImageContainer, 400, { leading: true });
if (this.$refs.imageBG) {
this.imageContainerResizeObserver = new ResizeObserver(this.resizeImageContainer);

View File

@ -128,7 +128,7 @@ export default {
return;
}
const isExistingView = viewProvider.key === this.existingView.key;
const isExistingView = viewProvider.key === this.existingView?.key;
this.clear();