diff --git a/src/modules/pages/connection/list/list.ts b/src/modules/pages/connection/list/list.ts index 2b5bb27..6f49bcf 100644 --- a/src/modules/pages/connection/list/list.ts +++ b/src/modules/pages/connection/list/list.ts @@ -33,8 +33,7 @@ export class ConnectionList extends BI.LoadingPane { } render() { - const connectionLength = BI.size(this.model.connections); - if (connectionLength === 0) { + if (BI.size(this.model.connections) === 0) { return { type: CenterAdapt, items: [ @@ -76,9 +75,6 @@ export class ConnectionList extends BI.LoadingPane { type: LoadingBar, ref: (_ref: any) => { this.loadingBar = _ref; - connectionLength > this.model.showItemNum ? - this.loadingBar.setLoaded() : - null; }, handler: () => { this.loadingBar.setLoading(); @@ -89,6 +85,14 @@ export class ConnectionList extends BI.LoadingPane { }; } + created() { + if (this.model.showItemNum) { + BI.size(this.model.connections) > this.model.showItemNum ? + this.loadingBar.setLoaded() : + null; + } + } + private renderList(start = 0) { const itemNum = Math.min(this.model.connections.length, this.model.showItemNum);