Get rid of some null checks for QR.db
QR is _always_ enabled in Appchan.
This commit is contained in:
parent
905a946a1e
commit
95ea42d104
@ -15111,16 +15111,15 @@
|
|||||||
return Unread.update();
|
return Unread.update();
|
||||||
},
|
},
|
||||||
addPost: function() {
|
addPost: function() {
|
||||||
var _ref;
|
|
||||||
if (this.isFetchedQuote || this.isClone) {
|
if (this.isFetchedQuote || this.isClone) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Unread.order.push(this);
|
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,
|
boardID: this.board.ID,
|
||||||
threadID: this.thread.ID,
|
threadID: this.thread.ID,
|
||||||
postID: this.ID
|
postID: this.ID
|
||||||
}) : void 0)) {
|
})) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Unread.posts.add(this.ID);
|
Unread.posts.add(this.ID);
|
||||||
@ -15128,11 +15127,11 @@
|
|||||||
return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
|
return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
|
||||||
},
|
},
|
||||||
addPostQuotingYou: function(post) {
|
addPostQuotingYou: function(post) {
|
||||||
var quotelink, _i, _len, _ref, _ref1;
|
var quotelink, _i, _len, _ref;
|
||||||
_ref = post.nodes.quotelinks;
|
_ref = post.nodes.quotelinks;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
quotelink = _ref[_i];
|
quotelink = _ref[_i];
|
||||||
if (!((_ref1 = QR.db) != null ? _ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
|
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Unread.postsQuotingYou.add(post.ID);
|
Unread.postsQuotingYou.add(post.ID);
|
||||||
@ -15179,7 +15178,7 @@
|
|||||||
return Unread.update();
|
return Unread.update();
|
||||||
},
|
},
|
||||||
read: $.debounce(100, function(e) {
|
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) {
|
if (d.hidden || !Unread.posts.size) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -15194,11 +15193,11 @@
|
|||||||
count++;
|
count++;
|
||||||
Unread.posts["delete"](ID);
|
Unread.posts["delete"](ID);
|
||||||
Unread.postsQuotingYou["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,
|
boardID: data.board.ID,
|
||||||
threadID: data.thread.ID,
|
threadID: data.thread.ID,
|
||||||
postID: ID
|
postID: ID
|
||||||
}) : void 0)) {
|
})) {
|
||||||
QuoteYou.lastRead = root;
|
QuoteYou.lastRead = root;
|
||||||
}
|
}
|
||||||
Unread.position = Unread.position.next;
|
Unread.position = Unread.position.next;
|
||||||
|
|||||||
@ -15127,16 +15127,15 @@
|
|||||||
return Unread.update();
|
return Unread.update();
|
||||||
},
|
},
|
||||||
addPost: function() {
|
addPost: function() {
|
||||||
var _ref;
|
|
||||||
if (this.isFetchedQuote || this.isClone) {
|
if (this.isFetchedQuote || this.isClone) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Unread.order.push(this);
|
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,
|
boardID: this.board.ID,
|
||||||
threadID: this.thread.ID,
|
threadID: this.thread.ID,
|
||||||
postID: this.ID
|
postID: this.ID
|
||||||
}) : void 0)) {
|
})) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Unread.posts.add(this.ID);
|
Unread.posts.add(this.ID);
|
||||||
@ -15144,11 +15143,11 @@
|
|||||||
return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
|
return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
|
||||||
},
|
},
|
||||||
addPostQuotingYou: function(post) {
|
addPostQuotingYou: function(post) {
|
||||||
var quotelink, _i, _len, _ref, _ref1;
|
var quotelink, _i, _len, _ref;
|
||||||
_ref = post.nodes.quotelinks;
|
_ref = post.nodes.quotelinks;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
quotelink = _ref[_i];
|
quotelink = _ref[_i];
|
||||||
if (!((_ref1 = QR.db) != null ? _ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
|
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Unread.postsQuotingYou.add(post.ID);
|
Unread.postsQuotingYou.add(post.ID);
|
||||||
@ -15195,7 +15194,7 @@
|
|||||||
return Unread.update();
|
return Unread.update();
|
||||||
},
|
},
|
||||||
read: $.debounce(100, function(e) {
|
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) {
|
if (d.hidden || !Unread.posts.size) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -15210,11 +15209,11 @@
|
|||||||
count++;
|
count++;
|
||||||
Unread.posts["delete"](ID);
|
Unread.posts["delete"](ID);
|
||||||
Unread.postsQuotingYou["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,
|
boardID: data.board.ID,
|
||||||
threadID: data.thread.ID,
|
threadID: data.thread.ID,
|
||||||
postID: ID
|
postID: ID
|
||||||
}) : void 0)) {
|
})) {
|
||||||
QuoteYou.lastRead = root;
|
QuoteYou.lastRead = root;
|
||||||
}
|
}
|
||||||
Unread.position = Unread.position.next;
|
Unread.position = Unread.position.next;
|
||||||
|
|||||||
@ -135,7 +135,7 @@ Unread =
|
|||||||
addPost: ->
|
addPost: ->
|
||||||
return if @isFetchedQuote or @isClone
|
return if @isFetchedQuote or @isClone
|
||||||
Unread.order.push @
|
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
|
boardID: @board.ID
|
||||||
threadID: @thread.ID
|
threadID: @thread.ID
|
||||||
postID: @ID
|
postID: @ID
|
||||||
@ -145,7 +145,7 @@ Unread =
|
|||||||
Unread.position ?= Unread.order[@ID]
|
Unread.position ?= Unread.order[@ID]
|
||||||
|
|
||||||
addPostQuotingYou: (post) ->
|
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.postsQuotingYou.add post.ID
|
||||||
Unread.openNotification post
|
Unread.openNotification post
|
||||||
return
|
return
|
||||||
@ -192,7 +192,7 @@ Unread =
|
|||||||
Unread.posts.delete ID
|
Unread.posts.delete ID
|
||||||
Unread.postsQuotingYou.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
|
boardID: data.board.ID
|
||||||
threadID: data.thread.ID
|
threadID: data.thread.ID
|
||||||
postID: ID
|
postID: ID
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user