Fix Code Editor Changes Creating Duplicate History Entries

Closes #4167
This commit is contained in:
Logan Tegman
2015-11-04 11:04:54 -08:00
parent f7c8932f8e
commit c38841c5af

View File

@ -136,8 +136,16 @@ common.codeUri = (function(common, encode, decode, location, history) {
if (!codeUri.enabled) { if (!codeUri.enabled) {
return null; return null;
} }
if (history && typeof history.replaceState === 'function') {
history.replaceState(
history.state,
null,
'?solution=' + codeUri.encode(encodeFcc(solution))
);
} else {
location.hash = '?solution=' + location.hash = '?solution=' +
codeUri.encode(encodeFcc(solution)); codeUri.encode(encodeFcc(solution));
}
return solution; return solution;
}, },