Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions packages/ringcentral-integration/modules/UserGuide/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,24 @@ export default class UserGuide extends RcModule {
@proxify
async _preLoadImage(url) {
await new Promise((resolve, reject) => {
let img = new Image();
const img = new Image();
img.src = url;
img.onload = resolve;
img.onerror = resolve;
})

});
}

@proxify
async preLoadImage(){
await this._preLoadImage(this.guides[0]);
async preLoadImage() {
const url = this.guides[0];
if (url) {
await this._preLoadImage(url);
}
this.store.dispatch({
type: this.actionTypes.preLoadImageStatus,
});
}

/**
* Using webpack `require.context` to load guides files.
* Image files will be ordered by file name ascendingly.
Expand Down Expand Up @@ -220,6 +222,7 @@ export default class UserGuide extends RcModule {
get status() {
return this.state.status;
}

get preLoadImageStatus() {
return this.state.preLoadImageStatus;
}
Expand Down