Merge branch 'main' of github.com:specklesystems/speckle-server
This commit is contained in:
@@ -426,7 +426,7 @@ jobs:
|
||||
test-dui-3:
|
||||
docker:
|
||||
- image: cimg/node:18.16.0
|
||||
resource_class: medium
|
||||
resource_class: medium+
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
|
||||
@@ -462,20 +462,14 @@ export class Viewer extends EventEmitter implements IViewer {
|
||||
token: string = null,
|
||||
enableCaching = true
|
||||
) {
|
||||
try {
|
||||
if (++this.inProgressOperations === 1)
|
||||
(this as EventEmitter).emit(ViewerEvent.Busy, true)
|
||||
|
||||
const loader = new ViewerObjectLoader(this, url, token, enableCaching)
|
||||
this.loaders[url] = loader
|
||||
await loader.load()
|
||||
} finally {
|
||||
if (--this.inProgressOperations === 0)
|
||||
(this as EventEmitter).emit(ViewerEvent.Busy, false)
|
||||
}
|
||||
const loader = new ViewerObjectLoader(this, url, token, enableCaching)
|
||||
this.loaders[url] = loader
|
||||
await loader.load()
|
||||
}
|
||||
|
||||
public async loadObject(url: string, token: string = null, enableCaching = true) {
|
||||
if (++this.inProgressOperations === 1)
|
||||
(this as EventEmitter).emit(ViewerEvent.Busy, true)
|
||||
await this.downloadObject(url, token, enableCaching)
|
||||
|
||||
let t0 = performance.now()
|
||||
@@ -491,6 +485,8 @@ export class Viewer extends EventEmitter implements IViewer {
|
||||
this.emit(ViewerEvent.LoadComplete, url)
|
||||
this.loaders[url].dispose()
|
||||
delete this.loaders[url]
|
||||
if (--this.inProgressOperations === 0)
|
||||
(this as EventEmitter).emit(ViewerEvent.Busy, false)
|
||||
}
|
||||
|
||||
public async loadObjectAsync(
|
||||
@@ -499,6 +495,8 @@ export class Viewer extends EventEmitter implements IViewer {
|
||||
enableCaching = true,
|
||||
priority = 1
|
||||
) {
|
||||
if (++this.inProgressOperations === 1)
|
||||
(this as EventEmitter).emit(ViewerEvent.Busy, true)
|
||||
await this.downloadObject(url, token, enableCaching)
|
||||
|
||||
let t0 = performance.now()
|
||||
@@ -514,6 +512,8 @@ export class Viewer extends EventEmitter implements IViewer {
|
||||
}
|
||||
this.loaders[url].dispose()
|
||||
delete this.loaders[url]
|
||||
if (--this.inProgressOperations === 0)
|
||||
(this as EventEmitter).emit(ViewerEvent.Busy, false)
|
||||
}
|
||||
|
||||
public async cancelLoad(url: string, unload = false) {
|
||||
@@ -522,8 +522,10 @@ export class Viewer extends EventEmitter implements IViewer {
|
||||
this.speckleRenderer.cancelRenderTree(url)
|
||||
if (unload) {
|
||||
await this.unloadObject(url)
|
||||
} else {
|
||||
if (--this.inProgressOperations === 0)
|
||||
(this as EventEmitter).emit(ViewerEvent.Busy, false)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
public async unloadObject(url: string) {
|
||||
|
||||
Reference in New Issue
Block a user