• Robert Knight's avatar
    Fix `groups.focused()` error if localStorage is empty when client loads · 2fef71a3
    Robert Knight authored
    If the client started and local storage did not contain a saved
    last-viewed group ID, then `groups.load()` would attempt to call
    `store.focusGroup(null)`. As a result subsequent calls to
    `groups.focused()` would return null and code in various places in the
    application expects that there will always be a focused group.
    
    Fix the problem by not setting the focus group after groups are fetched
    unless the previously-focused group was set and exists in the new
    groups list.
    
    Also improve the behavior of `store.focusGroup` by making it leave the
    focused group untouched if the specified group has not been loaded, but
    log an error so we'll know (via Sentry) if it happens again.
    
    Fixes #750
    2fef71a3
Name
Last commit
Last update
.github Loading commit data...
docs Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
gulpfile.js Loading commit data...
package.json Loading commit data...
requirements-dev.in Loading commit data...
yarn.lock Loading commit data...