MCPcopy Create free account
hub / github.com/codecombat/codecombat / onPollSync

Method onPollSync

app/views/play/CampaignView.js:2330–2336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2328 if (url == null) { url = `/db/poll/${this.userPollsRecord.id}/next` }
2329 let tempLoadingPoll = new Poll().setURL(url)
2330 const onPollSync = () => {
2331 if (this.destroyed) { return }
2332 tempLoadingPoll.url = () => '/db/poll/' + tempLoadingPoll.id
2333 this.poll = tempLoadingPoll
2334 const delay = forceShowPoll ? 1000 : 5000 // Wait a little bit before showing the poll
2335 setTimeout(() => this.activatePoll?.(forceShowPoll), delay)
2336 }
2337 const onPollError = (poll, response, request) => {
2338 if (response.status === 404) {
2339 console.log('There are no more polls left.')

Callers

nothing calls this directly

Calls 1

activatePollMethod · 0.95

Tested by

no test coverage detected