Skip to content

Commit

Permalink
dont save replay info in edit link
Browse files Browse the repository at this point in the history
  • Loading branch information
Swaroop Guggilam committed May 9, 2022
1 parent 716ef8a commit 236a024
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/js/class_p.js
Original file line number Diff line number Diff line change
Expand Up @@ -2853,6 +2853,10 @@ class Puzzle {
this.pu_a.command_undo.__a = [];
}

// No need to save replay information in edit link
this.pu_a.command_replay.__a = [];
this.pu_a_col.command_replay.__a;

text += JSON.stringify(this.pu_q) + "\n";
text += JSON.stringify(this.pu_a) + "\n";

Expand Down Expand Up @@ -2927,20 +2931,23 @@ class Puzzle {
var qu = this.pu_q.command_undo.__a;
var ar = this.pu_a.command_redo.__a;
var au = this.pu_a.command_undo.__a;
var are = this.pu_a.command_replay.__a;
this.pu_q.command_redo.__a = [];
this.pu_q.command_undo.__a = [];
this.pu_a.command_redo.__a = [];
if (this.mmode === "solve") {
// Retain undo in solve mode
} else {
this.pu_a.command_undo.__a = [];
this.pu_a.command_replay.__a = [];
}
text += JSON.stringify(this.pu_q) + "\n";
text += JSON.stringify(this.pu_a) + "\n";
this.pu_q.command_redo.__a = qr;
this.pu_q.command_undo.__a = qu;
this.pu_a.command_redo.__a = ar;
this.pu_a.command_undo.__a = au;
this.pu_a.command_replay.__a = are;

text += this.__export_list_tab_shared();

Expand All @@ -2964,16 +2971,24 @@ class Puzzle {
qu = this.pu_q_col.command_undo.__a;
ar = this.pu_a_col.command_redo.__a;
au = this.pu_a_col.command_undo.__a;
are = this.pu_a_col.command_replay.__a;
this.pu_q_col.command_redo.__a = [];
this.pu_q_col.command_undo.__a = [];
this.pu_a_col.command_redo.__a = [];
this.pu_a_col.command_undo.__a = [];

if (this.mmode === "solve") {
// Retain undo in solve mode
} else {
this.pu_a_col.command_undo.__a = [];
this.pu_a_col.command_replay.__a = [];
}
text += JSON.stringify(this.pu_q_col) + "\n";
text += JSON.stringify(this.pu_a_col) + "\n";
this.pu_q_col.command_redo.__a = qr;
this.pu_q_col.command_undo.__a = qu;
this.pu_a_col.command_redo.__a = ar;
this.pu_a_col.command_undo.__a = au;
this.pu_a_col.command_replay.__a = are;

text += this.__export_checker_shared();

Expand Down

0 comments on commit 236a024

Please sign in to comment.