From d41dfc1e0d91fa3b753713dc2f411639c4faea00 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Sat, 30 Sep 2023 19:27:16 +0200 Subject: [PATCH] Fixed wrong callback call from slider --- client/src/controls/slider.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/src/controls/slider.ts b/client/src/controls/slider.ts index 7b94c8a0..c715165d 100644 --- a/client/src/controls/slider.ts +++ b/client/src/controls/slider.ts @@ -63,14 +63,12 @@ export class Slider extends Control { setValue(newValue: number, ignoreExpectedValue: boolean = true) { if (!this.getDragged() && (ignoreExpectedValue || this.checkExpectedValue(newValue))) { - if (this.#value !== newValue) { + if (this.#value !== newValue) this.#value = newValue; - if (this.#callback) - this.#callback(this.getValue()); - } if (this.#slider != null) this.#slider.value = String((newValue - this.#minValue) / (this.#maxValue - this.#minValue) * parseFloat(this.#slider.max)); + this.#update(); } }