mirror of
https://github.com/skishore/makemeahanzi.git
synced 2025-11-01 20:27:44 +08:00
Escape characters in location.hash correctly
This commit is contained in:
@ -28,7 +28,7 @@ const changeGlyph = (method, argument) => {
|
|||||||
Meteor.call(method, argument, function(error, data) {
|
Meteor.call(method, argument, function(error, data) {
|
||||||
assert(!error, error);
|
assert(!error, error);
|
||||||
Session.set('editor.glyph', data);
|
Session.set('editor.glyph', data);
|
||||||
window.location.hash = data.character;
|
window.location.hash = encodeURIComponent(data.character);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ const incrementStage = (amount) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loadCharacter = () => {
|
const loadCharacter = () => {
|
||||||
const character = window.location.hash[1];
|
const character = decodeURIComponent(window.location.hash.slice(1));
|
||||||
const glyph = Session.get('editor.glyph');
|
const glyph = Session.get('editor.glyph');
|
||||||
if (!character) {
|
if (!character) {
|
||||||
changeGlyph('getNextGlyph');
|
changeGlyph('getNextGlyph');
|
||||||
|
|||||||
Reference in New Issue
Block a user