-
Notifications
You must be signed in to change notification settings - Fork 512
added front end support for auto update preference to fix issue #1633 #1751
Conversation
I found what was causing the back end part of the solution to not work, and have pushed a new commit to that pull request. This one doesn't require any further changes to support the functionality of keeping the same auto update setting when refreshing the browser. If there are any problems with the code or styling that I might have missed, please let me know and I will fix them as soon as I can. |
Okay, here's what I'm finding
Check out the GIF below. I have a javascript file that fires an alert every time the page is reloaded. Initially, auto-refresh is disabled, so my changes to the file don't trigger the alert. Then when I reload the browser you can see the 'auto refresh' is turned off - BUT - it's still refreshing the preview when I make changes to the doc. Let me know if you are finding something similar @timmoy - recommend just linking a JS file that includes an |
@timmoy grab me tomorrow if you want to debug this together. |
Good catch @flukeout, looks like the setting wasn't saved for the editor although it was for the UI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally works well! Nice job! Make the one small change and we can land this.
@@ -154,6 +154,14 @@ define(function(require) { | |||
_inspectorEnabled = data.enabled; | |||
}); | |||
|
|||
// Set initial auto-refresh toggle to last known setting | |||
if(bramble.getAutoUpdate() === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's simplify this logic:
if(!bramble.getAutoUpdate()) {
...
}
so that we remove the need for if...else
Double checking functionality now. |
Hey great work, just confirmed that the setting is remembered and works properly now. Once you make the changes requested by @gideonthomas in this PR and the brackets one we can go ahead and merge! |
The code has been optimized to remove the else branch and not do the comparison. |
Running this and the brackets patch together produces this error in the console for me... ...do you see this @timmoy |
@flukeout Indeed I got the same errors when I checked the console. I managed to debug the commandmanager error by taking out this line: I suspect there might be other bits of code that aren't needed and with that in mind I will continue to try and debug it. |
@timmoy don't remove that line, we need that. The errors are likely due to your The second set of errors you noticed are a known issue related to localization and running Brackets from |
See mozilla/brackets#595 (comment) for further fixes. |
Thanks for the contribution @timmoy! |
I added some code to handle issue #1633 to the bramble-ui-bridge.js file. The back end for this is mozilla/brackets#595.
This code just does the front end part, checking on load to see the preference stored for autoUpdate and changing the .refreshwrapper element to reflect that (by removing the checkmark if needed).
Final testing has yet to be done and will be done once the back end has been finalized as well.