When the brake sensors are triggered the motor assist ceases. Sometimes they dont cut power and other times you have no power but are not applying the brakes. In these scenarios disconnect the brake sensors and test riding will determine if either of the sensors are working and/or causing problems.
Find the connectors in front of the handlebars.
The inline Julet Connectors are 6 inches from the brake lever. Disconnect both left and right brake sensors and ride the bike with them unplugged. You should have completely normal pedal assist behavior even if you use the brakes.
Now plug in the left brake sensor and ride the bike. Do you have pedal assist? When you apply the brake does it cut power (keep pedaling or use throttle while braking with the left brake)?
Now unplug the left brake sensor and plug in the right one. Ride the bike. Do you have pedal assist? When you apply the brake does it cut power (keep pedaling or use throttle while braking with the left brake)?
If one/both sensors cut power when plugged in but no brake is applied you need to adjust or replace the sensor.
If the sensors are plugged in but do not cut power when the brakes are applied you need to adjust the sensor or replace the sensor.
Let us know what you discover.