Right now Bangle.js (and in fact any Espruino device) won't advertise while it's connected by Bluetooth, so it's not something you can fix in JavaScript I'm afraid.
It might be possible it's something that can be allowed with a change to the firmware itself, but it's not something I had planned I'm afraid.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Right now Bangle.js (and in fact any Espruino device) won't advertise while it's connected by Bluetooth, so it's not something you can fix in JavaScript I'm afraid.
It might be possible it's something that can be allowed with a change to the firmware itself, but it's not something I had planned I'm afraid.