Hide vote on close

This commit is contained in:
Gabriel Tofvesson 2022-10-22 14:43:14 +02:00
parent 7b0ddf25d5
commit 761a9f636d

View File

@ -411,9 +411,11 @@
const activeVote = firebase.functions().httpsCallable('activeVote'); const activeVote = firebase.functions().httpsCallable('activeVote');
function updateVote() { function updateVote() {
activeVote().then((data) => { activeVote().then((data) => {
if (data && data.data) { if (data) {
console.log(activeVoteData, data); if (!data.data) {
if (!activeVoteData || activeVoteData.voteId !== data.data.voteId) { activeVoteData = undefined;
updateVoteUI(true);
} else if (!activeVoteData || activeVoteData.voteId !== data.data.voteId) {
activeVoteData = data.data; activeVoteData = data.data;
console.log("Full update"); console.log("Full update");
updateVoteUI(true); updateVoteUI(true);