Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5487: Fix load issue with multiple same images #6170

Merged
merged 5 commits into from
Feb 10, 2019
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
6 changes: 2 additions & 4 deletions core/templates/dev/head/services/AssetsBackendApiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ oppia.factory('AssetsBackendApiService', [
if (_isCached(filename)) {
resolve(AudioFileObjectFactory.createNew(
filename, assetsCache[filename]));
} else if (!_isAssetCurrentlyBeingRequested(filename,
ASSET_TYPE_AUDIO)) {
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to combine this clause with the previous one? Ditto below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be better.

_fetchFile(explorationId, filename, ASSET_TYPE_AUDIO,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any difference in else if and else block? maybe we can just have else block? (ditto below)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanlip, has already covered this in his review!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

resolve, reject);
}
Expand All @@ -224,8 +223,7 @@ oppia.factory('AssetsBackendApiService', [
if (_isCached(filename)) {
resolve(ImageFileObjectFactory.createNew(
filename, assetsCache[filename]));
} else if (!_isAssetCurrentlyBeingRequested(filename,
ASSET_TYPE_IMAGE)) {
} else {
_fetchFile(explorationId, filename, ASSET_TYPE_IMAGE,
resolve, reject);
}
Expand Down