fix empty hash

master
Lucas Duailibe 2018-04-19 13:56:10 -03:00
parent f3cf50515d
commit a7a65aceb2
1 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,8 @@ import LZString from "lz-string";
export function read() {
const hash = document.location.hash.slice(1);
if (!hash) return {};
// backwards support for old json encoded URIComponent
const decode =
hash.indexOf("%7B%22") !== -1