Skip to content

Story log in Excel does not record the first change #10

@dmitry-weirdo

Description

@dmitry-weirdo

Since a strange ternary expression does not save the first "newState" value, the first is not saved to __log variable.

The fix may be as follows:

		, _logSetState: function(newState) {
			if ( this._log.length === 0 ) { // log first state
				let firstStateClone = this.state;
				this._log.push(firstStateClone);
			}

                        // always log newState
			let stateClone = JSON.parse( JSON.stringify(newState) );
			this._log.push(stateClone);

			this.setState(newState);
		}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions