Open BojanKogoj opened 3 years ago
I managed to get this exception in LocalizeRouterPipe, but hard to reproduce.
LocalizeRouterPipe
With current implementation
https://github.com/gilsdav/ngx-translate-router/blob/86d2e52f62d61d59d3b5d4c954f4a10f84ffda59/projects/ngx-translate-router/src/lib/localize-router.pipe.ts#L51-L56
I can only assume it was destroyed while in setTimeout. This was introduced in https://github.com/gilsdav/ngx-translate-router/commit/851563ab6f17bf748418f32fd22c97da01436efa.
setTimeout
I suggest we check if view was destroyed before calling .detectChanges() stackoverflow
.detectChanges()
setTimeout(() => { if (this._ref && !(this._ref as ViewRef).destroyed) { this._ref.detectChanges(); } }, 0)
Is it compatible with and without Ivy ?
I managed to get this exception in
LocalizeRouterPipe
, but hard to reproduce.With current implementation
https://github.com/gilsdav/ngx-translate-router/blob/86d2e52f62d61d59d3b5d4c954f4a10f84ffda59/projects/ngx-translate-router/src/lib/localize-router.pipe.ts#L51-L56
I can only assume it was destroyed while in
setTimeout
. This was introduced in https://github.com/gilsdav/ngx-translate-router/commit/851563ab6f17bf748418f32fd22c97da01436efa.I suggest we check if view was destroyed before calling
.detectChanges()
stackoverflow