Skip to content

Commit

Permalink
Fix: Use local storage to cache media settings (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Press authored Oct 16, 2017
1 parent 09c279d commit e26e323
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lib/viewers/media/MediaBaseViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class MediaBaseViewer extends BaseViewer {
* @return {void}
*/
setVolume(volume) {
this.cache.set(MEDIA_VOLUME_CACHE_KEY, volume);
this.cache.set(MEDIA_VOLUME_CACHE_KEY, volume, true);
this.handleVolume();
}

Expand Down Expand Up @@ -488,9 +488,9 @@ class MediaBaseViewer extends BaseViewer {
toggleMute() {
if (this.mediaEl.volume) {
this.oldVolume = this.mediaEl.volume;
this.cache.set(MEDIA_VOLUME_CACHE_KEY, 0);
this.cache.set(MEDIA_VOLUME_CACHE_KEY, 0, true);
} else {
this.cache.set(MEDIA_VOLUME_CACHE_KEY, this.oldVolume);
this.cache.set(MEDIA_VOLUME_CACHE_KEY, this.oldVolume, true);
}
this.handleVolume();
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/viewers/media/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ class Settings extends EventEmitter {
*/
chooseOption(type, value) {
// Save the value
this.cache.set(`media-${type}`, value);
this.cache.set(`media-${type}`, value, true);

// Emit to the listener what was chosen
this.emit(type);
Expand Down

0 comments on commit e26e323

Please sign in to comment.