First pass on CI support
This commit is contained in:
parent
746e99b8c2
commit
990e501850
7 changed files with 55 additions and 19 deletions
|
@ -193,17 +193,7 @@
|
|||
this.setDeviceNameDefault();
|
||||
|
||||
return new Promise(resolve => {
|
||||
this.$('#link-phone').submit(e => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
let name = this.$(DEVICE_NAME_SELECTOR).val();
|
||||
name = name.replace(/\0/g, ''); // strip unicode null
|
||||
if (name.trim().length === 0) {
|
||||
this.$(DEVICE_NAME_SELECTOR).focus();
|
||||
return null;
|
||||
}
|
||||
|
||||
const onDeviceName = name => {
|
||||
this.selectStep(Steps.PROGRESS_BAR);
|
||||
|
||||
const finish = () => {
|
||||
|
@ -227,6 +217,26 @@
|
|||
);
|
||||
return finish();
|
||||
});
|
||||
};
|
||||
|
||||
if (window.CI) {
|
||||
onDeviceName(window.CI.deviceName);
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
this.$('#link-phone').submit(e => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
let name = this.$(DEVICE_NAME_SELECTOR).val();
|
||||
name = name.replace(/\0/g, ''); // strip unicode null
|
||||
if (name.trim().length === 0) {
|
||||
this.$(DEVICE_NAME_SELECTOR).focus();
|
||||
return null;
|
||||
}
|
||||
|
||||
onDeviceName(name);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue