Created Utils.DEFAULT_PROXY and referenced it everywhere

This commit is contained in:
Samuel Crypto
2018-11-02 08:07:31 -04:00
parent f47b4c8f6c
commit 66cde07135
4 changed files with 15 additions and 6 deletions
+2 -3
View File
@@ -7,7 +7,6 @@ const CONTAINER_UNHIDE_SRC = "/img/container-unhide.svg";
const DEFAULT_COLOR = "blue";
const DEFAULT_ICON = "circle";
const NEW_CONTAINER_ID = "new";
const DEFAULT_PROXY = {type: "direct"};
const ONBOARDING_STORAGE_KEY = "onboarding-stage";
@@ -967,7 +966,7 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
icon: formValues.get("container-icon") || DEFAULT_ICON,
color: formValues.get("container-color") || DEFAULT_COLOR
},
proxy: proxifiedContainers.parseProxy(document.getElementById("edit-container-panel-proxy").value) || DEFAULT_PROXY
proxy: proxifiedContainers.parseProxy(document.getElementById("edit-container-panel-proxy").value) || Utils.DEFAULT_PROXY
}
});
await Logic.refreshIdentities();
@@ -1085,7 +1084,7 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
edit_proxy_dom(result.proxy);
}, (error) => {
if(error.error === "uninitialized" || error.error === "doesnotexist") {
proxifiedContainers.set(identity.cookieStoreId, DEFAULT_PROXY, error.error === "uninitialized").then((result) => {
proxifiedContainers.set(identity.cookieStoreId, Utils.DEFAULT_PROXY, error.error === "uninitialized").then((result) => {
edit_proxy_dom(result);
}, (error) => {
proxifiedContainers.report_proxy_error(error, "popup.js: unexpected set(...) error");