Don't clear the launcher string if the connection was not a success.
This commit is contained in:
@@ -458,11 +458,14 @@ class Wizard {
|
|||||||
*
|
*
|
||||||
* @param {function} builder Command builder
|
* @param {function} builder Command builder
|
||||||
* @param {subscribe.Subscribe} subs Wizard step subscriber
|
* @param {subscribe.Subscribe} subs Wizard step subscriber
|
||||||
|
* @param {function} done Callback which will be called when the wizard
|
||||||
|
* is done
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
constructor(built, subs) {
|
constructor(built, subs, done) {
|
||||||
this.built = built;
|
this.built = built;
|
||||||
this.subs = subs;
|
this.subs = subs;
|
||||||
|
this.done = done;
|
||||||
this.closed = false;
|
this.closed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,6 +486,7 @@ class Wizard {
|
|||||||
|
|
||||||
if (n.type() === NEXT_DONE) {
|
if (n.type() === NEXT_DONE) {
|
||||||
this.close();
|
this.close();
|
||||||
|
this.done(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Next(n);
|
return new Next(n);
|
||||||
@@ -629,16 +633,18 @@ class Builder {
|
|||||||
* @param {controls.Controls} controls
|
* @param {controls.Controls} controls
|
||||||
* @param {history.History} history
|
* @param {history.History} history
|
||||||
* @param {object} config
|
* @param {object} config
|
||||||
|
* @param {function} done Callback which will be called when wizard is done
|
||||||
*
|
*
|
||||||
* @returns {Wizard} Command wizard
|
* @returns {Wizard} Command wizard
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
build(streams, controls, history, config) {
|
build(streams, controls, history, config, done) {
|
||||||
let subs = new subscribe.Subscribe();
|
let subs = new subscribe.Subscribe();
|
||||||
|
|
||||||
return new Wizard(
|
return new Wizard(
|
||||||
this.builder(new Info(this), config, streams, subs, controls, history),
|
this.builder(new Info(this), config, streams, subs, controls, history),
|
||||||
subs
|
subs,
|
||||||
|
done
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -649,11 +655,12 @@ class Builder {
|
|||||||
* @param {controls.Controls} controls
|
* @param {controls.Controls} controls
|
||||||
* @param {history.History} history
|
* @param {history.History} history
|
||||||
* @param {string} launcher Launcher format
|
* @param {string} launcher Launcher format
|
||||||
|
* @param {function} done Callback which will be called when launching is done
|
||||||
*
|
*
|
||||||
* @returns {Wizard} Command wizard
|
* @returns {Wizard} Command wizard
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
launch(streams, controls, history, launcher) {
|
launch(streams, controls, history, launcher, done) {
|
||||||
let subs = new subscribe.Subscribe();
|
let subs = new subscribe.Subscribe();
|
||||||
|
|
||||||
return new Wizard(
|
return new Wizard(
|
||||||
@@ -665,7 +672,8 @@ class Builder {
|
|||||||
controls,
|
controls,
|
||||||
history
|
history
|
||||||
),
|
),
|
||||||
subs
|
subs,
|
||||||
|
done
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
19
ui/home.vue
19
ui/home.vue
@@ -226,9 +226,13 @@ export default {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
if (this.query.length > 1 && this.query.indexOf("+") === 0) {
|
if (this.query.length > 1 && this.query.indexOf("+") === 0) {
|
||||||
this.connectLaunch(this.query.slice(1, this.query.length));
|
this.connectLaunch(this.query.slice(1, this.query.length), success => {
|
||||||
|
if (!success) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.$emit("navigate-to", "");
|
this.$emit("navigate-to", "");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
@@ -315,7 +319,8 @@ export default {
|
|||||||
stream,
|
stream,
|
||||||
this.controls,
|
this.controls,
|
||||||
this.connector.historyRec,
|
this.connector.historyRec,
|
||||||
null
|
null,
|
||||||
|
() => {}
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -355,7 +360,8 @@ export default {
|
|||||||
stream,
|
stream,
|
||||||
this.controls,
|
this.controls,
|
||||||
this.connector.historyRec,
|
this.connector.historyRec,
|
||||||
known.data
|
known.data,
|
||||||
|
() => {}
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -375,7 +381,7 @@ export default {
|
|||||||
query: ll.slice(llSeparatorIdx + 1, ll.length)
|
query: ll.slice(llSeparatorIdx + 1, ll.length)
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
connectLaunch(launcher) {
|
connectLaunch(launcher, done) {
|
||||||
this.showConnectWindow();
|
this.showConnectWindow();
|
||||||
|
|
||||||
this.runConnect(stream => {
|
this.runConnect(stream => {
|
||||||
@@ -398,7 +404,10 @@ export default {
|
|||||||
stream,
|
stream,
|
||||||
this.controls,
|
this.controls,
|
||||||
this.connector.historyRec,
|
this.connector.historyRec,
|
||||||
ll.query
|
ll.query,
|
||||||
|
n => {
|
||||||
|
done(n.data().success);
|
||||||
|
}
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user