Skip to content

Undo restores incorrect ctx #389

Description

@mgrau

When performing an undo operation, ctx takes the value of 2 moves prior, instead of 1 move prior. This is particularly problematic when a move changes the phase. I've found that using

        return {
          ...state,
          G: restore.G,
          ctx: last.ctx,
          _undo: _undo.slice(0, _undo.length - 1),
          _redo: [last, ..._redo],
        };

seems to give the correct behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions