()
| 115 | |
| 116 | /** Leave the RuSense tab — stop the stream and free the mounted view. */ |
| 117 | export function suspend() { |
| 118 | if (current && current.cleanup) { |
| 119 | try { current.cleanup(); } catch (e) { /* ignore */ } |
| 120 | current = { route: current.route, cleanup: null }; |
| 121 | } |
| 122 | if (viewEl) viewEl.innerHTML = ''; |
| 123 | // Allow the next init()/show() to remount the (now-wiped) view. |
| 124 | activeRoute = null; |
| 125 | try { sensingService.stop(); } catch (e) { /* ignore */ } |
| 126 | started = false; |
| 127 | } |