Prevent multiple prepare calls
This commit is contained in:
parent
b5d32c73e6
commit
6df5220e02
@ -29,12 +29,16 @@ class DisplayFloat extends Display {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this._orphaned = false;
|
this._orphaned = false;
|
||||||
|
this._prepareInvoked = false;
|
||||||
|
|
||||||
yomichan.on('orphaned', () => this.onOrphaned());
|
yomichan.on('orphaned', () => this.onOrphaned());
|
||||||
window.addEventListener('message', (e) => this.onMessage(e), false);
|
window.addEventListener('message', (e) => this.onMessage(e), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
async prepare(options, popupInfo, url, childrenSupported, scale, uniqueId) {
|
async prepare(options, popupInfo, url, childrenSupported, scale, uniqueId) {
|
||||||
|
if (this._prepareInvoked) { return; }
|
||||||
|
this._prepareInvoked = true;
|
||||||
|
|
||||||
await super.prepare(options);
|
await super.prepare(options);
|
||||||
|
|
||||||
const {id, depth, parentFrameId} = popupInfo;
|
const {id, depth, parentFrameId} = popupInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user