Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Snowflake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shelikhoo
Snowflake
Commits
4494dbd3
Commit
4494dbd3
authored
5 years ago
by
Cecylia Bocovich
Browse files
Options
Downloads
Patches
Plain Diff
Move toggle initiation init-webext.coffee
Prevents repeat calls to update() on startup
parent
6210b5ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
proxy/init-webext.coffee
+1
-1
1 addition, 1 deletion
proxy/init-webext.coffee
proxy/ui.coffee
+11
-11
11 additions, 11 deletions
proxy/ui.coffee
with
12 additions
and
12 deletions
proxy/init-webext.coffee
+
1
−
1
View file @
4494dbd3
...
...
@@ -24,7 +24,7 @@ init = () ->
snowflake
=
new
Snowflake
config
,
ui
,
broker
log
'== snowflake proxy =='
u
pdat
e
()
u
i
.
initToggl
e
()
update
=
()
->
if
!
ui
.
enabled
...
...
This diff is collapsed.
Click to expand it.
proxy/ui.coffee
+
11
−
11
View file @
4494dbd3
...
...
@@ -59,7 +59,6 @@ class WebExtUI extends UI
constructor
:
->
@
initStats
()
@
initToggle
()
chrome
.
runtime
.
onConnect
.
addListener
@
onConnect
initStats
:
->
...
...
@@ -71,16 +70,13 @@ class WebExtUI extends UI
),
60
*
60
*
1000
initToggle
:
->
try
getting
=
chrome
.
storage
.
local
.
get
(
"snowflake-enabled"
,
(
result
)
=>
if
result
[
'snowflake-enabled'
]
!=
undefined
@
enabled
=
result
[
'snowflake-enabled'
]
@
setEnabled
@
enabled
else
log
"Toggle state not yet saved"
)
catch
log
"Error retrieving toggle state"
getting
=
chrome
.
storage
.
local
.
get
(
"snowflake-enabled"
,
(
result
)
=>
if
result
[
'snowflake-enabled'
]
!=
undefined
@
enabled
=
result
[
'snowflake-enabled'
]
else
log
"Toggle state not yet saved"
@
setEnabled
@
enabled
)
postActive
:
->
@
port
?
.
postMessage
...
...
@@ -114,6 +110,10 @@ class WebExtUI extends UI
chrome
.
browserAction
.
setIcon
path
:
32
:
"icons/status-running.png"
else
chrome
.
browserAction
.
setIcon
path
:
32
:
"icons/status-on.png"
setEnabled
:
(
enabled
)
->
update
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment