First pass on CI support

This commit is contained in:
Fedor Indutny 2021-03-25 19:02:53 -07:00 committed by GitHub
parent 746e99b8c2
commit 990e501850
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 55 additions and 19 deletions

View file

@ -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);
});
});
},