Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
ca472783
Commit
ca472783
authored
Feb 06, 2017
by
Sean Roberts
Committed by
GitHub
Feb 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #208 from hypothesis/remove-session-changed-event
Remove unused SESSION_CHANGED event
parents
454f05c4
9999efd6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
35 deletions
+0
-35
events.js
src/sidebar/events.js
+0
-4
session.js
src/sidebar/session.js
+0
-4
session-test.js
src/sidebar/test/session-test.js
+0
-27
No files found.
src/sidebar/events.js
View file @
ca472783
...
...
@@ -11,10 +11,6 @@ module.exports = {
GROUPS_CHANGED
:
'groupsChanged'
,
/** The logged-in user changed */
USER_CHANGED
:
'userChanged'
,
/**
* The session state was updated.
*/
SESSION_CHANGED
:
'sessionChanged'
,
// UI state changes
...
...
src/sidebar/session.js
View file @
ca472783
...
...
@@ -137,10 +137,6 @@ function session($http, $resource, $rootScope, annotationUI, auth,
lastLoad
=
Promise
.
resolve
(
model
);
lastLoadTime
=
Date
.
now
();
$rootScope
.
$broadcast
(
events
.
SESSION_CHANGED
,
{
initialLoad
:
isInitialLoad
,
});
if
(
userChanged
)
{
auth
.
clearCache
();
...
...
src/sidebar/test/session-test.js
View file @
ca472783
...
...
@@ -227,33 +227,6 @@ describe('session', function () {
});
describe
(
'#update()'
,
function
()
{
it
(
'broadcasts SESSION_CHANGED when the session changes'
,
function
()
{
var
sessionChangeCallback
=
sinon
.
stub
();
// the initial load should trigger a SESSION_CHANGED event
// with initialLoad set
$rootScope
.
$on
(
events
.
SESSION_CHANGED
,
sessionChangeCallback
);
session
.
update
({
groups
:
[{
id
:
'groupid'
,
}],
csrf
:
'dummytoken'
,
});
assert
.
calledWith
(
sessionChangeCallback
,
sinon
.
match
({}),
{
initialLoad
:
true
});
// subsequent loads should trigger a SESSION_CHANGED event
sessionChangeCallback
.
reset
();
session
.
update
({
groups
:
[{
id
:
'groupid2'
,
}],
csrf
:
'dummytoken'
,
});
assert
.
calledWith
(
sessionChangeCallback
,
sinon
.
match
({}),
{
initialLoad
:
false
});
});
it
(
'broadcasts GROUPS_CHANGED when the groups change'
,
function
()
{
var
groupChangeCallback
=
sinon
.
stub
();
$rootScope
.
$on
(
events
.
GROUPS_CHANGED
,
groupChangeCallback
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment