Moves login state of dialog to be first, to be the initial state.
By default impromptu uses the first state as the default one to show.
This commit is contained in:
@@ -62,29 +62,6 @@ function LoginDialog(successCallback, cancelCallback) {
|
||||
}
|
||||
|
||||
const states = {
|
||||
connecting: {
|
||||
buttons: [],
|
||||
defaultButton: 0,
|
||||
html: '<div id="connectionStatus"></div>',
|
||||
titleKey: 'dialog.connecting'
|
||||
},
|
||||
finished: {
|
||||
buttons: finishedButtons,
|
||||
defaultButton: 0,
|
||||
html: '<div id="errorMessage"></div>',
|
||||
titleKey: 'dialog.error',
|
||||
|
||||
submit(e, v) {
|
||||
e.preventDefault();
|
||||
if (v === 'retry') {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
connDialog.goToState('login');
|
||||
} else {
|
||||
// User cancelled
|
||||
cancelCallback();
|
||||
}
|
||||
}
|
||||
},
|
||||
login: {
|
||||
buttons: loginButtons,
|
||||
focus: ':input:first',
|
||||
@@ -107,6 +84,29 @@ function LoginDialog(successCallback, cancelCallback) {
|
||||
cancelCallback();
|
||||
}
|
||||
}
|
||||
},
|
||||
connecting: {
|
||||
buttons: [],
|
||||
defaultButton: 0,
|
||||
html: '<div id="connectionStatus"></div>',
|
||||
titleKey: 'dialog.connecting'
|
||||
},
|
||||
finished: {
|
||||
buttons: finishedButtons,
|
||||
defaultButton: 0,
|
||||
html: '<div id="errorMessage"></div>',
|
||||
titleKey: 'dialog.error',
|
||||
|
||||
submit(e, v) {
|
||||
e.preventDefault();
|
||||
if (v === 'retry') {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
connDialog.goToState('login');
|
||||
} else {
|
||||
// User cancelled
|
||||
cancelCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const connDialog = APP.UI.messageHandler.openDialogWithStates(
|
||||
|
||||
Reference in New Issue
Block a user