a strange fix

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-09-22 12:38:09 +02:00
parent 64b5e14208
commit 479fb21600
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
3 changed files with 4 additions and 7 deletions

View File

@ -75,13 +75,13 @@ class ClientImpl implements Client {
this.hierarchy.tx(tx) this.hierarchy.tx(tx)
await this.model.tx(tx) await this.model.tx(tx)
} }
await this.conn.tx(tx)
this.notify?.(tx) this.notify?.(tx)
await this.conn.tx(tx)
} }
async updateFromRemote (tx: Tx): Promise<void> { async updateFromRemote (tx: Tx): Promise<void> {
console.log('UPDATE FROM REMOTE')
if (tx.objectSpace === core.space.Model) { if (tx.objectSpace === core.space.Model) {
console.log('update from remote')
this.hierarchy.tx(tx) this.hierarchy.tx(tx)
await this.model.tx(tx) await this.model.tx(tx)
} }

View File

@ -83,10 +83,7 @@ export class LiveQuery extends TxProcessor implements Client {
}) })
return () => { return () => {
console.log('queries', this.queries.length)
console.log('removing query:', this.queries.indexOf(q))
this.queries.splice(this.queries.indexOf(q), 1) this.queries.splice(this.queries.indexOf(q), 1)
console.log('queries', this.queries.length)
} }
} }

View File

@ -72,12 +72,12 @@
} }
async function move(to: number) { async function move(to: number) {
await client.updateDoc(core.class.SpaceWithStates, core.space.Model, _id, { client.updateDoc(core.class.SpaceWithStates, core.space.Model, _id, {
$pull: { $pull: {
states: dragState states: dragState
} }
}) })
await client.updateDoc(core.class.SpaceWithStates, core.space.Model, _id, { client.updateDoc(core.class.SpaceWithStates, core.space.Model, _id, {
$push: { $push: {
states: { states: {
$each: [dragState], $each: [dragState],