function initializeMainMenu() {
  console.log("init");
  sendAutolock();
  checkKeychainify();
  manageKey = false;
  getPref = false;
  chrome.storage.local.get(
    ["accounts", "last_account", "rpc", "current_rpc", "transfer_to"],
    function(items) {
      to_autocomplete = items.transfer_to ? JSON.parse(items.transfer_to) : {};
      if (items.accounts)
        accountsList.init(
          decryptToJson(items.accounts, mk),
          items.last_account
        );
      loadRPC(items.current_rpc);
      console.log(accountsList.getList());
      $("#accounts").empty();
      if (!accountsList.isEmpty()) {
        $(".usernames").html("<select></select>");
        for (account of accountsList.getList()) {
          $(".usernames select").append(
            "<option>" + account.getName() + "</option>"
          );
        }
        $(".usernames select")
          .eq(0)
          .append(
            `<option name='add_account'>${chrome.i18n.getMessage(
              "popup_add_account"
            )}</option>`
          );
        initiateCustomSelect();
      } else {
        $("#main").hide();
        $("#register").hide();
        $("#add_account_types_div").show();
        $("#add_account_types_div .back_enabled").addClass("back_disabled");
      }
    }
  );
}
// Set visibilities back to normal when coming back to main menu
Set visibilities back to normal when coming back to main menu
Set visibilities back to normal when coming back to main menu
function initializeMainMenu() {
  console.log("init");
  sendAutolock();
  checkKeychainify();
  manageKey = false;
  getPref = false;
  chrome.storage.local.get(
    ["accounts", "last_account", "rpc", "current_rpc", "transfer_to"],
    function(items) {
      to_autocomplete = items.transfer_to ? JSON.parse(items.transfer_to) : {};
      if (items.accounts)
        accountsList.init(
          decryptToJson(items.accounts, mk),
          items.last_account
        );
      loadRPC(items.current_rpc);
      console.log(accountsList.getList());
      $("#accounts").empty();
      if (!accountsList.isEmpty()) {
        $(".usernames").html("<select></select>");
        for (account of accountsList.getList()) {
          $(".usernames select").append(
            "<option>" + account.getName() + "</option>"
          );
        }
        $(".usernames select")
          .eq(0)
          .append(
            `<option name='add_account'>${chrome.i18n.getMessage(
              "popup_add_account"
            )}</option>`
          );
        initiateCustomSelect();
      } else {
        $("#main").hide();
        $("#register").hide();
        $("#add_account_types_div").show();
        $("#add_account_types_div .back_enabled").addClass("back_disabled");
      }
    }
  );
}
function initializeMainMenu ( ) { console . log ( "init" ) ; sendAutolock ( ) ; checkKeychainify ( ) ; manageKey = false ; getPref = false ; chrome . storage . local . get ( [ "accounts" , "last_account" , "rpc" , "current_rpc" , "transfer_to" ] , function ( items ) { to_autocomplete = items . transfer_to ? JSON . parse ( items . transfer_to ) : { } ; if ( items . accounts ) accountsList . init ( decryptToJson ( items . accounts , mk ) , items . last_account ) ; loadRPC ( items . current_rpc ) ; console . log ( accountsList . getList ( ) ) ; $ ( "#accounts" ) . empty ( ) ; if ( ! accountsList . isEmpty ( ) ) { $ ( ".usernames" ) . html ( "<select></select>" ) ; for ( account of accountsList . getList ( ) ) { $ ( ".usernames select" ) . append ( "<option>" + account . getName ( ) + "</option>" ) ; } $ ( ".usernames select" ) . eq ( 0 ) . append ( ` ${ chrome . i18n . getMessage ( "popup_add_account" ) } ` ) ; initiateCustomSelect ( ) ; } else { $ ( "#main" ) . hide ( ) ; $ ( "#register" ) . hide ( ) ; $ ( "#add_account_types_div" ) . show ( ) ; $ ( "#add_account_types_div .back_enabled" ) . addClass ( "back_disabled" ) ; } } ) ; }
Set visibilities back to normal when coming back to main menu
Set visibilities back to normal when coming back to main menu