Skip to content

Commit 582bb56

Browse files
committed
#1374: Clicking away from "Function Apps" node, and then clicking back, causes loading to never end
1 parent b1e879f commit 582bb56

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

AzureFunctions.AngularClient/src/app/apps-list/apps-list.component.ts

+8
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@ export class AppsListComponent implements OnInit, OnDestroy {
2929
.distinctUntilChanged()
3030
.switchMap(viewInfo =>{
3131
this.appsNode = (<AppsNode>viewInfo.node);
32+
/* this is need to avoid flickering b/w no list view & table on load
33+
see https://github.com/Azure/azure-functions-ux/issues/1286 */
3234
this.appsNode.isLoading = true;
3335
return (<AppsNode>viewInfo.node).childrenStream;
3436
})
3537
.subscribe(children =>{
3638
this.apps = children;
39+
40+
/* fix for https://github.com/Azure/azure-functions-ux/issues/1374
41+
if the FunctionApps node has a sibling, the below logic will need to be updated */
42+
if(children.length > 0){
43+
this.appsNode.isLoading = false;
44+
}
3745
this._origRefToItems = children;
3846
});
3947

AzureFunctions.AngularClient/src/app/tree-view/apps-node.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export class AppsNode extends TreeNode implements MutableCollection, Disposable,
4747
this.iconClass = "root-node-collection-icon"
4848
this.iconUrl = "images/BulletList.svg";
4949
this.showExpandIcon = false;
50-
5150
this.childrenStream.subscribe(children =>{
5251
this.children = children;
5352
})
@@ -68,11 +67,10 @@ export class AppsNode extends TreeNode implements MutableCollection, Disposable,
6867
})
6968
.switchMap(result =>{
7069
this.childrenStream.next([]);
71-
70+
7271
if(!result.subscriptions || result.subscriptions.length === 0){
7372
return Observable.of(null);
7473
}
75-
7674
this.isLoading = true;
7775
this._subscriptions = result.subscriptions;
7876
return this._doSearch(<AppNode[]>this.children, result.searchTerm, result.subscriptions, 0, null);

0 commit comments

Comments
 (0)