From 223275fd65a5c5d13a1f8320fe807d8da6c00b58 Mon Sep 17 00:00:00 2001 From: Caitlin Hennessy Date: Wed, 13 Dec 2017 13:35:28 -0800 Subject: [PATCH] Moving a line of code --- libs/color-sensor/color.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/color-sensor/color.ts b/libs/color-sensor/color.ts index 0638c5c3..e5351839 100644 --- a/libs/color-sensor/color.ts +++ b/libs/color-sensor/color.ts @@ -106,9 +106,9 @@ namespace sensors { //% weight=100 blockGap=8 //% group="Color Sensor" onColorDetected(color: ColorSensorColor, handler: () => void) { + this.setMode(ColorSensorMode.Color) const v = this._colorEventValue(color); control.onEvent(this._id, v, handler); - this.setMode(ColorSensorMode.Color) if (this.color() == color) control.raiseEvent(this._id, v); }