Stop OE connection spinner when user closes connection dialog (#2777)

This commit is contained in:
Matt Irvine
2018-10-05 14:14:19 -07:00
committed by GitHub
parent 48b899b5d0
commit 8a8745701b
8 changed files with 27 additions and 7 deletions

View File

@@ -130,14 +130,16 @@ export class TreeUpdateUtils {
if (tree) {
// Show the spinner in OE by adding the 'loading' trait to the connection, and set up callbacks to hide the spinner
tree.addTraits('loading', [connection]);
let rejectOrCancelCallback = () => {
tree.collapse(connection);
tree.removeTraits('loading', [connection]);
};
callbacks = {
onConnectStart: undefined,
onConnectReject: () => {
tree.collapse(connection);
tree.removeTraits('loading', [connection]);
},
onConnectReject: rejectOrCancelCallback,
onConnectSuccess: () => tree.removeTraits('loading', [connection]),
onDisconnect: undefined
onDisconnect: undefined,
onConnectCanceled: rejectOrCancelCallback,
};
}
connectionManagementService.connect(connection, undefined, options, callbacks).then(result => {