blob: 853c07c010f960ba938003c2a2457234f1f477db (
plain) (
tree)
|
|
import { defaultTimer } from "./timerTemplate";
export const configFromLink = () => {
const config = window.location.hash;
if (config === "") {
return [{ ...defaultTimer }];
}
return JSON
.parse(decodeURIComponent(escape(window.atob(config.replace("#", "")))))
.map(t => ({ ...defaultTimer, name: t[0], initialTime: t[1], time: t[1] }));
}
|