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');
function updateVote() {
activeVote().then((data) => {
if (data && data.data) {
console.log(activeVoteData, data);
if (!activeVoteData || activeVoteData.voteId !== data.data.voteId) {
if (data) {
if (!data.data) {
activeVoteData = undefined;
updateVoteUI(true);
} else if (!activeVoteData || activeVoteData.voteId !== data.data.voteId) {
activeVoteData = data.data;
console.log("Full update");
updateVoteUI(true);