Get rid of some null checks for QR.db

QR is _always_ enabled in Appchan.
This commit is contained in:
Zixaphir 2015-01-14 11:44:58 -07:00
parent 905a946a1e
commit 95ea42d104
3 changed files with 17 additions and 19 deletions

View File

@ -15111,16 +15111,15 @@
return Unread.update();
},
addPost: function() {
var _ref;
if (this.isFetchedQuote || this.isClone) {
return;
}
Unread.order.push(this);
if (this.ID <= Unread.lastReadPost || this.isHidden || ((_ref = QR.db) != null ? _ref.get({
if (this.ID <= Unread.lastReadPost || this.isHidden || QR.db.get({
boardID: this.board.ID,
threadID: this.thread.ID,
postID: this.ID
}) : void 0)) {
})) {
return;
}
Unread.posts.add(this.ID);
@ -15128,11 +15127,11 @@
return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
},
addPostQuotingYou: function(post) {
var quotelink, _i, _len, _ref, _ref1;
var quotelink, _i, _len, _ref;
_ref = post.nodes.quotelinks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quotelink = _ref[_i];
if (!((_ref1 = QR.db) != null ? _ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
continue;
}
Unread.postsQuotingYou.add(post.ID);
@ -15179,7 +15178,7 @@
return Unread.update();
},
read: $.debounce(100, function(e) {
var ID, count, data, height, root, _ref, _ref1;
var ID, count, data, height, root, _ref;
if (d.hidden || !Unread.posts.size) {
return;
}
@ -15194,11 +15193,11 @@
count++;
Unread.posts["delete"](ID);
Unread.postsQuotingYou["delete"](ID);
if (Conf['Mark Quotes of You'] && ((_ref1 = QR.db) != null ? _ref1.get({
if (Conf['Mark Quotes of You'] && QR.db.get({
boardID: data.board.ID,
threadID: data.thread.ID,
postID: ID
}) : void 0)) {
})) {
QuoteYou.lastRead = root;
}
Unread.position = Unread.position.next;

View File

@ -15127,16 +15127,15 @@
return Unread.update();
},
addPost: function() {
var _ref;
if (this.isFetchedQuote || this.isClone) {
return;
}
Unread.order.push(this);
if (this.ID <= Unread.lastReadPost || this.isHidden || ((_ref = QR.db) != null ? _ref.get({
if (this.ID <= Unread.lastReadPost || this.isHidden || QR.db.get({
boardID: this.board.ID,
threadID: this.thread.ID,
postID: this.ID
}) : void 0)) {
})) {
return;
}
Unread.posts.add(this.ID);
@ -15144,11 +15143,11 @@
return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
},
addPostQuotingYou: function(post) {
var quotelink, _i, _len, _ref, _ref1;
var quotelink, _i, _len, _ref;
_ref = post.nodes.quotelinks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quotelink = _ref[_i];
if (!((_ref1 = QR.db) != null ? _ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
continue;
}
Unread.postsQuotingYou.add(post.ID);
@ -15195,7 +15194,7 @@
return Unread.update();
},
read: $.debounce(100, function(e) {
var ID, count, data, height, root, _ref, _ref1;
var ID, count, data, height, root, _ref;
if (d.hidden || !Unread.posts.size) {
return;
}
@ -15210,11 +15209,11 @@
count++;
Unread.posts["delete"](ID);
Unread.postsQuotingYou["delete"](ID);
if (Conf['Mark Quotes of You'] && ((_ref1 = QR.db) != null ? _ref1.get({
if (Conf['Mark Quotes of You'] && QR.db.get({
boardID: data.board.ID,
threadID: data.thread.ID,
postID: ID
}) : void 0)) {
})) {
QuoteYou.lastRead = root;
}
Unread.position = Unread.position.next;

View File

@ -135,7 +135,7 @@ Unread =
addPost: ->
return if @isFetchedQuote or @isClone
Unread.order.push @
return if @ID <= Unread.lastReadPost or @isHidden or QR.db?.get {
return if @ID <= Unread.lastReadPost or @isHidden or QR.db.get {
boardID: @board.ID
threadID: @thread.ID
postID: @ID
@ -145,7 +145,7 @@ Unread =
Unread.position ?= Unread.order[@ID]
addPostQuotingYou: (post) ->
for quotelink in post.nodes.quotelinks when QR.db?.get Get.postDataFromLink quotelink
for quotelink in post.nodes.quotelinks when QR.db.get Get.postDataFromLink quotelink
Unread.postsQuotingYou.add post.ID
Unread.openNotification post
return
@ -192,7 +192,7 @@ Unread =
Unread.posts.delete ID
Unread.postsQuotingYou.delete ID
if Conf['Mark Quotes of You'] and QR.db?.get {
if Conf['Mark Quotes of You'] and QR.db.get {
boardID: data.board.ID
threadID: data.thread.ID
postID: ID