From 7fc0a1fb5052305d60b38fb8ca65a624dd01b906 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 28 Feb 2024 10:59:27 +0100 Subject: [PATCH] Fix wrong unlistener condition Actually we don't need a condition. --- CHANGES.md | 2 +- src/olcs/Camera.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cb59e45d4..80291ff9e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ * Changes * Support dashed lines by converting the pattern - + * Fix unlistening condition in camera._setView ## v 2.19.2 diff --git a/src/olcs/Camera.ts b/src/olcs/Camera.ts index 7c8b44a69..4e4f129a5 100644 --- a/src/olcs/Camera.ts +++ b/src/olcs/Camera.ts @@ -69,10 +69,8 @@ export default class Camera { * @private */ setView_(view: View | undefined) { - if (this.view_) { - olObservableUnByKey(this.viewListenKey_); - this.viewListenKey_ = null; - } + olObservableUnByKey(this.viewListenKey_); + this.viewListenKey_ = null; this.view_ = view; if (view) {