Skip to content
Snippets Groups Projects
Commit d01a9fe3 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed minor loading issue

parent 17d1b80e
No related branches found
No related tags found
No related merge requests found
......@@ -127,8 +127,8 @@ class App {
after: 4,
before: 4
})).then(result => {
const before = result.filter(msg => msg.id < context.anchorBefore);
const after = result.filter(msg => msg.id > context.anchorAfter);
const before = result.filter(msg => msg.messageid < context.anchorBefore);
const after = result.filter(msg => msg.messageid > context.anchorAfter);
context.loadBefore(before.map(msg => new Message(msg.messageid, msg.time, msg.sender, msg.message)));
context.loadAfter(after.map(msg => new Message(msg.messageid, msg.time, msg.sender, msg.message)));
context.setLoading(false);
......
......@@ -139,8 +139,8 @@ class App {
after: 4,
before: 4
})).then((result) => {
const before = result.filter((msg) => msg.id < context.anchorBefore);
const after = result.filter((msg) => msg.id > context.anchorAfter);
const before = result.filter((msg) => msg.messageid < context.anchorBefore);
const after = result.filter((msg) => msg.messageid > context.anchorAfter);
context.loadBefore(before.map((msg) => new Message(msg.messageid, msg.time, msg.sender, msg.message)));
context.loadAfter(after.map((msg) => new Message(msg.messageid, msg.time, msg.sender, msg.message)));
......
......@@ -37,7 +37,7 @@ class Context extends Component {
if (focus === undefined)
focus = !this.elem.classList.contains('focus');
if (this.anchorBefore === this.message.id && this.anchorAfter === this.message.id) {
this.triggerloadInitial();
this.triggerLoadInitial();
}
this.elem.classList.toggle('focus', focus);
this.sendEvent('focus', focus);
......@@ -57,7 +57,7 @@ class Context extends Component {
triggerLoadAfter() {
this.sendEvent('loadAfter', [this]);
}
triggerloadInitial() {
triggerLoadInitial() {
this.sendEvent('loadInitial', [this]);
}
loadBefore(elements) {
......
......@@ -42,7 +42,7 @@ class Context extends Component {
focus = !this.elem.classList.contains("focus");
if (this.anchorBefore === this.message.id && this.anchorAfter === this.message.id) {
this.triggerloadInitial();
this.triggerLoadInitial();
}
this.elem.classList.toggle("focus", focus);
......@@ -68,7 +68,7 @@ class Context extends Component {
this.sendEvent("loadAfter", [this]);
}
triggerloadInitial() {
triggerLoadInitial() {
this.sendEvent("loadInitial", [this]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment