diff --git a/frontend/static/js/result.js b/frontend/static/js/result.js index a3ce44d..62a480a 100644 --- a/frontend/static/js/result.js +++ b/frontend/static/js/result.js @@ -35,7 +35,7 @@ function domLoaded() { }; try { - drawChart(JSON.parse(POLL_VOTE_DATA_STRING)); + drawChart(JSON.parse(window.atob(POLL_VOTE_DATA_STRING))); } catch (error) { // eh } diff --git a/src/frontend.ts b/src/frontend.ts index a08e6be..9a2ea3f 100644 --- a/src/frontend.ts +++ b/src/frontend.ts @@ -123,7 +123,7 @@ export default function init(router: Router): void { "POLL_OPTION_DIVS": pollOptionsDivs, "POLL_VOTES_TOTAL": totalVotes, "BACKEND_BASE_PATH": (program.opts().backendBaseUrl || ""), - "POLL_OPTION_VOTES": JSON.stringify(Object.entries(poll.votes)) + "POLL_OPTION_VOTES": Buffer.from(JSON.stringify(Object.entries(poll.votes))).toString("base64") }); } catch (error) { console.log(error);