Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
fix: #26 quick switch bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyu committed Oct 17, 2022
1 parent 84840ba commit 1feaccf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,20 @@ class AddonPreview extends AddonModule {
) {
return;
}
let item = await this.updatePreviewItem(type !== this.lastType || force);

let { iframe } = this.getPreviewElements(type);

let item = await this.updatePreviewItem(
type !== this.lastType ||
// @ts-ignore
this.item?.id !== iframe.contentWindow.cachedData.itemID ||
force
);
console.log(item);
if (force && !item) {
item = this.item;
}

let { iframe } = this.getPreviewElements(type);
if (item) {
if (this._loadingPromise) {
await this._loadingPromise.promise;
Expand Down

0 comments on commit 1feaccf

Please sign in to comment.