Skip to content

Commit

Permalink
minor changes to threadloader (should use loki index)
Browse files Browse the repository at this point in the history
bind eventmodel.removefromthread
  • Loading branch information
robguthrie committed Nov 2, 2023
1 parent 107fd0d commit f3f41f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions vue/src/shared/loaders/thread_loader.js
Expand Up @@ -277,7 +277,7 @@ export default class ThreadLoader {
local: {
find: {
discussionId: this.discussion.id,
sequenceId: {'$jgte': id}
sequenceId: {'$gte': id}
},
simplesort: 'sequenceId',
limit: this.padding
Expand Down Expand Up @@ -357,7 +357,7 @@ export default class ThreadLoader {
local: {
find: {
discussionId: this.discussion.id,
sequenceId: {$jgte: id}
sequenceId: {$gte: id}
},
limit: this.padding,
order: 'sequenceId'
Expand All @@ -373,7 +373,6 @@ export default class ThreadLoader {

addRule(rule) {
const ruleString = JSON.stringify(rule);

if (!this.ruleStrings.includes(ruleString)) {
this.rules.push(rule);
this.ruleStrings.push(ruleString);
Expand Down Expand Up @@ -472,7 +471,7 @@ export default class ThreadLoader {
const lastPosition = (parentExists && (collection[0].event.parent().childCount)) || 0;


return collection.forEach(obj => {
collection.forEach(obj => {
obj.isUnread = this.isUnread(obj.event);
const isFirstInRange = some(ranges, range => range[0] === obj.event.position);
const isLastInLastRange = last(ranges)[1] === obj.event.position;
Expand All @@ -494,7 +493,7 @@ export default class ThreadLoader {
obj.missingAfterCount = (missingAfter && (lastPosition - last(ranges)[1])) || 0;
obj.missingChildCount = obj.event.childCount - obj.children.length;

if (obj.children.length) { return this.addMetaData(obj.children); }
if (obj.children.length) { this.addMetaData(obj.children); }
});
}
}
2 changes: 1 addition & 1 deletion vue/src/shared/models/event_model.js
Expand Up @@ -10,7 +10,7 @@ export default class EventModel extends BaseModel {

constructor(...args) {
super(...args);
// this.removeFromThread = this.removeFromThread.bind(this);
this.removeFromThread = this.removeFromThread.bind(this);
}

relationships() {
Expand Down

0 comments on commit f3f41f9

Please sign in to comment.