mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: Allow Discourse.Session.current()
API to update to 0
This commit is contained in:
parent
91efbc1830
commit
8d08391ff5
3 changed files with 5 additions and 3 deletions
|
@ -27,8 +27,8 @@ Discourse.Session.reopenClass({
|
|||
}
|
||||
|
||||
// If we found the current session
|
||||
if (property) {
|
||||
if (value) {
|
||||
if (typeof property !== "undefined") {
|
||||
if (typeof value !== "undefined") {
|
||||
this.currentSession.set(property, value);
|
||||
} else {
|
||||
return this.currentSession.get(property);
|
||||
|
|
|
@ -301,7 +301,7 @@ Discourse.User.reopenClass({
|
|||
}
|
||||
|
||||
// If we found the current user
|
||||
if (this.currentUser && property) {
|
||||
if (this.currentUser && (typeof property !== "undefined")) {
|
||||
return this.currentUser.get(property);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@ test('current', function(){
|
|||
Discourse.Session.current('orange', 'juice');
|
||||
equal(session.get('orange'), "juice", "it can be updated");
|
||||
|
||||
Discourse.Session.current('zero', 0);
|
||||
equal(session.get('zero'), 0);
|
||||
});
|
||||
|
||||
test('highestSeenByTopic', function() {
|
||||
|
|
Loading…
Reference in a new issue