self.onDataUpdated = function() {
let defaulthttpconfig={
ignoreLoading:false,
ignoreErrors:false,
resendRequest:false
customerId={entityType:'CUSTOMER',id:self.ctx.currentUser.customerId};
let pl = new self.ctx.pageLink(100,0,null,null);
const uu='/api/alarm/DEVICE/';
const bb='?pageSize=100&page=0';
// nested subscriptions
const outer$=deviceService.getUserDevices(pl,'MYProfile',defaulthttpconfig);
outer$.pipe(
self.ctx.rxjs.switchMap( data => {
//return self.ctx.rxjs.of(data); // <-- no refresh triggered
return http.get(uu+data.data[0].id.id+bb,defaulthttpconfig); // <--refresh triggered
).subscribe(console.log,console.error);
Surprisingly, this nested subscription triggers a refresh of the widget as seen in the following gif:
This refresh propagates into the widget-types view which makes it hard to add new widgets because the edit-menu is refreshed every couple of seconds. See the next gif.
Is there any way to prevent this behavior?
Environment
OS: Win 10
ThingsBoard: PE 3.3.1
Browser: Chrome