Skip to content

Commit

Permalink
✨🐞 Improve/rethink/fix Live Preview (#431)
Browse files Browse the repository at this point in the history
Parent issue: sequentech/meta#752
  • Loading branch information
Findeton committed Jun 22, 2024
1 parent 454530a commit edecc91
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions avAdmin/admin-directives/create/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -1334,9 +1334,15 @@ angular.module('avAdmin')
var foundElection = scope.elections.find(function (element) { return true === element.virtual; });
electionId = foundElection && foundElection.id || electionId;
}
sessionStorage.setItem(electionId, JSON.stringify(scope.elections));
var url = window.location.origin +"/booth/" + electionId + "/preview-vote";
window.open(url, '_blank');

Authmethod.createLivePreview(JSON.stringify(scope.elections))
.then(
function onSuccess(response) {
var previewId = response.data.id;
var url = window.location.origin +"/booth/" + electionId + "/uuid-preview-vote?uuid="+previewId;
window.open(url, '_blank');
}
);
return true;
};

Expand Down

0 comments on commit edecc91

Please sign in to comment.