forked from fair/matrix-puppeteer-line
Actually print message on incorrect email/password
This commit is contained in:
parent
884d0d32fe
commit
04c09cea1f
|
@ -58,14 +58,6 @@ export default class MessagesPuppeteer {
|
||||||
console.error(`[Puppeteer/${this.id}]`, ...text)
|
console.error(`[Puppeteer/${this.id}]`, ...text)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the inner text of an element.
|
|
||||||
* To be called in browser context.
|
|
||||||
*/
|
|
||||||
_getInnerText(element) {
|
|
||||||
return element?.innerText
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start the browser and open the messages for web page.
|
* Start the browser and open the messages for web page.
|
||||||
* This must be called before doing anything else.
|
* This must be called before doing anything else.
|
||||||
|
@ -213,11 +205,12 @@ export default class MessagesPuppeteer {
|
||||||
return value
|
return value
|
||||||
}),
|
}),
|
||||||
() => this.page.waitForSelector("#login_incorrect", {visible: true, timeout: 2000})
|
() => this.page.waitForSelector("#login_incorrect", {visible: true, timeout: 2000})
|
||||||
.then(value => this.page.evaluate(_getInnerText, value)),
|
.then(value => this.page.evaluate(element => element?.innerText, value)),
|
||||||
() => this._waitForLoginCancel(),
|
() => this._waitForLoginCancel(),
|
||||||
].map(promiseFn => cancelableResolve(promiseFn)))
|
].map(promiseFn => cancelableResolve(promiseFn)))
|
||||||
|
|
||||||
this.log("Removing observers")
|
this.log("Removing observers")
|
||||||
|
// TODO __mautrixController is undefined when cancelling, why?
|
||||||
await this.page.evaluate(ownID => window.__mautrixController.setOwnID(ownID), this.id)
|
await this.page.evaluate(ownID => window.__mautrixController.setOwnID(ownID), this.id)
|
||||||
await this.page.evaluate(() => window.__mautrixController.removeQRChangeObserver())
|
await this.page.evaluate(() => window.__mautrixController.removeQRChangeObserver())
|
||||||
await this.page.evaluate(() => window.__mautrixController.removeQRAppearObserver())
|
await this.page.evaluate(() => window.__mautrixController.removeQRAppearObserver())
|
||||||
|
|
Loading…
Reference in New Issue