From cab4bd749ce9e1e6d6973c8c43ab8f8776808c0b Mon Sep 17 00:00:00 2001 From: Aidan Campbell Date: Fri, 19 Feb 2016 16:13:38 -0500 Subject: [PATCH] fixed bug where previous bitrate would not load --- static/js/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index 9084ec4..79f8fba 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -153,16 +153,20 @@ function saveBitrate() { } function onWindowLoad(){ + // don't show the game selection div document.getElementById('gameSelection').style.display = 'none'; $("#bitrateField").addClass("bitrateField"); + // load stored resolution prefs chrome.storage.sync.get('resolution', function(previousValue) { $('#selectResolution')[0].remove(0); $('#selectResolution')[0].value = previousValue.resolution != null ? previousValue.resolution : '1280:720'; }); + // load stored framerate prefs chrome.storage.sync.get('frameRate', function(previousValue) { $('#selectFramerate')[0].remove(0); $('#selectFramerate')[0].value = previousValue.frameRate != null ? previousValue.frameRate : '30'; }); + // load previously connected hosts chrome.storage.sync.get('hosts', function(previousValue) { hosts = previousValue.hosts != null ? previousValue.hosts : []; if ($('#selectHost')[0].length > 0) { @@ -175,8 +179,8 @@ function onWindowLoad(){ $('#selectHost')[0].appendChild(opt); } }); - - chrome.storage.sync.get('hosts', function(previousValue) { + // load stored bitrate prefs + chrome.storage.sync.get('bitrate', function(previousValue) { $('#bitrateSlider')[0].MaterialSlider.change(previousValue.bitrate != null ? previousValue.bitrate : '15'); updateBitrateField(); });