From e26e3231b27a429eccfb54cdcefd7ed332069765 Mon Sep 17 00:00:00 2001 From: Jeremy Press Date: Mon, 16 Oct 2017 10:20:22 -0700 Subject: [PATCH] Fix: Use local storage to cache media settings (#432) --- src/lib/viewers/media/MediaBaseViewer.js | 6 +++--- src/lib/viewers/media/Settings.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/viewers/media/MediaBaseViewer.js b/src/lib/viewers/media/MediaBaseViewer.js index 7eceeb2ab..7a4646749 100644 --- a/src/lib/viewers/media/MediaBaseViewer.js +++ b/src/lib/viewers/media/MediaBaseViewer.js @@ -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(); } @@ -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(); } diff --git a/src/lib/viewers/media/Settings.js b/src/lib/viewers/media/Settings.js index 16204fc92..8a2beaf7b 100644 --- a/src/lib/viewers/media/Settings.js +++ b/src/lib/viewers/media/Settings.js @@ -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);