Skip to content

Commit

Permalink
fix(state): init State id in the emptyState function
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricenclos committed Nov 21, 2018
1 parent d119b5c commit 24751b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sync/State.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LogootSRopes } from 'mute-structs'
import { SafeAny } from 'safe-any'
import { generateId } from '../misc'
import { RichLogootSOperation } from './RichLogootSOperation'

interface StateJSON {
Expand Down Expand Up @@ -30,7 +31,8 @@ export class State {
}

static emptyState() {
return new State(new Map(), [], new LogootSRopes(), 0, 0)
const id = generateId()
return new State(new Map(), [], new LogootSRopes(id), 0, id)
}

static fromPlainText(o: SafeAny<StateJSON>): State | null {
Expand Down

0 comments on commit 24751b2

Please sign in to comment.