Skip to content

Commit

Permalink
set small delay on postResults to make sure template is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensV committed Jun 22, 2023
1 parent 3daaa50 commit 7509e6d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pages/campaigns/_id/_batch/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
:html="renderTemplate(
campaign.info.template || 'No template found..',
campaign.info.example_task || {})"
:is-live-task="true"
@submit="submitTask"
:isLiveTask="true"
/>
</div>

Expand Down Expand Up @@ -255,8 +255,8 @@
:html="renderTemplate(
campaign.info.template || 'No template found..',
viewTaskResult.placeholders)"
:is-live-task="true"
@templateLoaded="postResults(viewTaskResult.results)"
:isLiveTask="true"
/>
</div>
<button class="modal-close is-large" aria-label="close" @click="viewTaskResult = false" />
Expand Down Expand Up @@ -643,10 +643,12 @@ export default {
postResults (results) {
const frame = document.getElementById('mediaFrame')
if (frame) {
frame.contentWindow.postMessage(
{ task: 'results', value: results },
'*'
)
setTimeout(() => {
frame.contentWindow.postMessage(
{ task: 'results', value: results },
'*'
)
}, 250)
}
},
async viewTask (sub) {
Expand Down

0 comments on commit 7509e6d

Please sign in to comment.