Semantic-Society / Neologism

MIT License
6 stars 2 forks source link

[BUG] Reloading edit view of vocabulary #204

Closed enisze closed 2 years ago

enisze commented 3 years ago

The toolbar for zoom in and zoom out is doubled. Moving the toolbar displays another one in the background of the mx-graph component.

alihussainiam commented 2 years ago

Why ? : The issue is due to angular life cycle hook being called twice which initilizes toolbar twice and overrides reference where only one is movable. Similarly on component destroy hook it destroys the last overriden referenced component

alihussainiam commented 2 years ago

This piece of code was added a while ago for debugging in the app.module. This is responsible for bootsrapping the application twice in the browser which was redunantly added hence the whole app was being instantiated twice.

platformBrowserDynamic().bootstrapModule(AppModule).then(moduleRef => { const applicationRef = moduleRef.injector.get(ApplicationRef); const componentRef = applicationRef.components[0]; // allows to run 'ng.profiler.timeChangeDetection();' enableDebugTools(componentRef); }).catch(err => window['console'].error(err));