racing conditions on callback function #126

This commit is contained in:
kovacsv 2021-08-26 08:22:48 +02:00
parent 3d43bdb3c9
commit 079427a5d8

View File

@ -127,8 +127,6 @@ OV.Website = class
OnModelFinished (importResult, threeMeshes) OnModelFinished (importResult, threeMeshes)
{ {
let importedExtension = OV.GetFileExtension (importResult.mainFile);
this.eventHandler.HandleEvent ('model_loaded', { extension : importedExtension });
this.model = importResult.model; this.model = importResult.model;
this.ShowViewer (true); this.ShowViewer (true);
this.viewer.AddMeshes (threeMeshes); this.viewer.AddMeshes (threeMeshes);
@ -444,6 +442,8 @@ OV.Website = class
onFinish : (importResult, threeMeshes) => onFinish : (importResult, threeMeshes) =>
{ {
this.OnModelFinished (importResult, threeMeshes); this.OnModelFinished (importResult, threeMeshes);
let importedExtension = OV.GetFileExtension (importResult.mainFile);
this.eventHandler.HandleEvent ('model_loaded', { extension : importedExtension });
}, },
onRender : () => onRender : () =>
{ {