From b94e7cd0c28909cd3d7b83e0f610aae20f3921ab Mon Sep 17 00:00:00 2001 From: "R. Aidan Campbell" Date: Sat, 3 Sep 2016 18:12:34 -0400 Subject: [PATCH] further optimized caching, and minor bugfix --- static/js/index.js | 1 - static/js/utils.js | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/static/js/index.js b/static/js/index.js index c5a7b7a..a6c0c99 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -319,7 +319,6 @@ function unpairClicked(host) { $('#continueUnpairHost').on('click', function () { host.unpair().then(function (onSuccess) { var unpairHostDialog = document.querySelector('#unpairHostDialog'); - unpairHostDialog.close(); $('#host-container-' + host.serverUid).remove(); snackbarLog('Successfully unpaired from host'); delete hosts[host.serverUid]; // remove the host from the array; diff --git a/static/js/utils.js b/static/js/utils.js index 8edac61..1005dad 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -294,7 +294,13 @@ NvHTTP.prototype = { return this.getAppListWithCacheFlush(); }, + // warms `this` _memCachedBoxArtArray with ALL box art from ALL servers + // this is inefficient, but works well. warmBoxArtCache: function () { + if (!this.paired) { + console.log('not warming box art cache from unpaired host.'); + return; + } if (Object.keys(this._memCachedBoxArtArray).length != 0) { console.log('box art cache already warmed.'); return;