Skip to content

Commit

Permalink
only connect to socket if path has been replaced, fixes #4776
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Jul 23, 2019
1 parent 9ca576a commit f179eda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/extension/app/background.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ once = require("lodash/once")
Promise = require("bluebird")
{ client, circularParser } = require("@packages/socket/lib/browser")

HOST_PATH_REPLACED = false
HOST = "CHANGE_ME_HOST"
PATH = "CHANGE_ME_PATH"

Expand Down Expand Up @@ -70,7 +71,8 @@ connect = (host, path) ->
return ws

## initially connect
connect(HOST, PATH)
if HOST_PATH_REPLACED
connect(HOST, PATH)

automation = {
connect
Expand Down
1 change: 1 addition & 0 deletions packages/extension/lib/extension.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
fs.readFileAsync(src, "utf8")
.then (str) ->
str
.replace("HOST_PATH_REPLACED = false", "HOST_PATH_REPLACED = true")
.replace("CHANGE_ME_HOST", host)
.replace("CHANGE_ME_PATH", path)

Expand Down

0 comments on commit f179eda

Please sign in to comment.