Skip to content

Commit

Permalink
initialize default options in browser extension
Browse files Browse the repository at this point in the history
  • Loading branch information
snopf committed Feb 5, 2020
1 parent b1a5317 commit e7b245f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 11 additions & 7 deletions src/host/browser_extension/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
var account_table = {};

// Options for the extension
options = {}
var options;

// Get the currently selected hostname
function get_hostname() { return $('#input_hostname').val(); }
Expand Down Expand Up @@ -193,12 +193,16 @@ function ask_device_plugged_in() {
// Get the current options
function get_options() {
// Set to automatically hit enter if selected in settings
chrome.storage.sync.get(null, function(items) {
options = items
// Continue init process by asking bg script for pin
// after we received our options
ask_for_pin();
});
chrome.storage.sync.get({
'save_info': true,
'save_pin_active_session': true,
'hit_enter': false},
function(items) {
options = items;
// Continue init process by asking bg script for pin
// after we received our options
ask_for_pin();
});
}

// Ask the background script for the pin
Expand Down
4 changes: 1 addition & 3 deletions todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ AVR
- Casing!


Bugs:
----------------------------------------------------------------------
- must initialize options page for browser extension to make requests

0 comments on commit e7b245f

Please sign in to comment.