style(frontend/player):type fixes
This commit is contained in:
parent
47774191b1
commit
a4f2191757
5 changed files with 9 additions and 5 deletions
|
|
@ -147,7 +147,7 @@ export default class MessageDistributor extends StatedScreen {
|
|||
|
||||
// @ts-ignore Hack for upet (TODO: fix ordering in one mutation in tracker(removes first))
|
||||
const headChildrenIds = msgs.filter(m => m.parentID === 1).map(m => m.id);
|
||||
this.pagesManager.sort((m1, m2) => {
|
||||
this.pagesManager.sortPages((m1, m2) => {
|
||||
if (m1.time === m2.time) {
|
||||
if (m1.tp === "remove_node" && m2.tp !== "remove_node") {
|
||||
if (headChildrenIds.includes(m1.id)) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ export default class Cursor {
|
|||
}, 600)
|
||||
}
|
||||
|
||||
// TODO (to keep on a different playig speed):
|
||||
// transition
|
||||
// setTransitionSpeed()
|
||||
|
||||
getPosition(): Point {
|
||||
return { x: this.position.x, y: this.position.y };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ export default class ListWalker<T extends Timed> {
|
|||
this.p = 0
|
||||
}
|
||||
|
||||
sort(comparator): void {
|
||||
sort(comparator: (a: T, b: T) => number): void {
|
||||
// @ts-ignore
|
||||
this._list.sort((m1,m2) => comparator(m1,m2) || (m1._index - m2._index) ); // indexes for sort stability (TODO: fix types???)
|
||||
}
|
||||
|
||||
forEach(f):void {
|
||||
forEach(f: (item: T) => void):void {
|
||||
this._list.forEach(f);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export default class PagesManager extends ListWalker<DOMManager> {
|
|||
this.last.append(m)
|
||||
}
|
||||
|
||||
sort(comparator) {
|
||||
sortPages(comparator: (a: Message, b: Message) => number) {
|
||||
this.forEach(page => page.sort(comparator))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -751,7 +751,7 @@ export default class RawMessageReader extends PrimitiveReader {
|
|||
}
|
||||
|
||||
default:
|
||||
throw new Error(`Unrecognizable message type: ${ tp }`)
|
||||
throw new Error(`Unrecognizable message type: ${ tp }; Pointer at the position ${this.p} of ${this.buf.length}`)
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue