Skip to content

Commit

Permalink
fix: dynamic data reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Sova committed Nov 11, 2023
1 parent e5e33d2 commit f815500
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jam-do/ims",
"version": "1.0.1",
"version": "1.0.2",
"description": "Interactive Media Spots",
"main": "index.js",
"type": "module",
Expand Down
12 changes: 9 additions & 3 deletions spots/photo-spinner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class PhotoSpinner extends AppCom {
this._directionStep = cfg.invertDirection ? -1 : 1;

if (!cfg.showPlaceholder) {
this._loadContents(cfg);
this._loadContents(cfg, true);
this.setAttribute('active', '');
} else {
this._showPreview();
Expand All @@ -76,8 +76,14 @@ export class PhotoSpinner extends AppCom {
this._progressBar.progress = val;
}

_loadContents(cfg) {
if (this._imgLoadingInitialized && !this.preview) {
/**
*
* @param {*} cfg
* @param {Boolean} force
* @returns
*/
_loadContents(cfg, force = false) {
if (this._imgLoadingInitialized && !this.preview && !force) {
return;
}
// TODO: switch to firestore id
Expand Down
Loading

0 comments on commit f815500

Please sign in to comment.