Fix Code Editor Changes Creating Duplicate History Entries
Closes #4167
This commit is contained in:
@ -136,8 +136,16 @@ common.codeUri = (function(common, encode, decode, location, history) {
|
|||||||
if (!codeUri.enabled) {
|
if (!codeUri.enabled) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
location.hash = '?solution=' +
|
if (history && typeof history.replaceState === 'function') {
|
||||||
codeUri.encode(encodeFcc(solution));
|
history.replaceState(
|
||||||
|
history.state,
|
||||||
|
null,
|
||||||
|
'?solution=' + codeUri.encode(encodeFcc(solution))
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
location.hash = '?solution=' +
|
||||||
|
codeUri.encode(encodeFcc(solution));
|
||||||
|
}
|
||||||
|
|
||||||
return solution;
|
return solution;
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user