Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip] When not browser focused on a view that refreshes, don’t refresh #139

Open
wants to merge 40 commits into
base: 0.9-dev
Choose a base branch
from

Conversation

lukebooth
Copy link
Contributor

This would halt the ticker when you’re not currently looking at a view that does polling. Regaining focus calls the given callback and restarts the view.

If you don't think this is a good idea or needs improvement, just comment on this. Thanks

…ions rather than UI, and added the ability to revoke an authorization (1.5h)

Tying authorizations makes it easier to see who added an authorization and who has the ability to delete it; and affords creating multiple authorizations between Houston and a given Provider — for different accounts.

Defining Providers via extensions rather than UI keeps Client secrets out of the database, and allows modules to name providers and declare their dependance on authorizations to a certain provider.

Adding “My Authorizations” allows users to always be able to see their own authorizations and revoke them.
@boblail
Copy link
Member

boblail commented Feb 28, 2017

Luke, do you think this'll mess up the dashboards? — like if one of those error messages shows up that we can't click on — or if they never have keyboard focus, they'll just not work?

What do you think of this?

Here's how the Alerts Dashboard uses the Refresher:

new Refresher()
  // ...
  .callback(function() {
    $.get('/alerts/dashboard' + window.location.search, {limit: limit}).done(renderAlerts);
  }).render();

What if the Refresher supported an option where: if callback returned a Promise, it would do something like this:

  1. The refresher completes its circle
  2. If @waitingForPromise is true, then it stops the refresher
  3. Otherwise, it calls callback and checks the return value
  4. If callback's return value is a promise, it sets @waitingForPromise = true, calls done on the promise, and, when done is invoked, sets @waitingForPromise = false and, if necessary, resumes the refresher

Clients of Refresher would opt-in to this behavior by returning a promise.

We would then modify the Alerts Dashboard to opt-in to this feature like so:

  new Refresher()
    // ...
    .callback(function() {
-     $.get('/alerts/dashboard' + window.location.search, {limit: limit}).done(renderAlerts);
+     return $.get('/alerts/dashboard' + window.location.search, {limit: limit}).done(renderAlerts);
    }).render();

@boblail boblail force-pushed the 0.9-dev branch 2 times, most recently from c4992b5 to 1c04023 Compare March 30, 2017 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants