(forceShowPoll)
| 2353 | } |
| 2354 | |
| 2355 | activatePoll (forceShowPoll) { |
| 2356 | if (this.shouldShow('promotion')) { return } |
| 2357 | if (!this.poll) { return } |
| 2358 | const pollTitle = utils.i18n(this.poll.attributes, 'name') |
| 2359 | const $pollButton = this.$el.find('button.poll') |
| 2360 | .removeClass('hidden') |
| 2361 | .addClass('highlighted') |
| 2362 | .attr({ title: pollTitle }) |
| 2363 | .addClass('has-tooltip') |
| 2364 | .tooltip({ title: pollTitle }) |
| 2365 | |
| 2366 | if ((me.get('lastLevel') === 'shadow-guard') || forceShowPoll) { |
| 2367 | return this.showPoll() |
| 2368 | } else { |
| 2369 | $pollButton.tooltip('show') |
| 2370 | setTimeout(() => { |
| 2371 | $pollButton?.tooltip('hide') |
| 2372 | if (!this.destroyed) { |
| 2373 | storage.save('ignored-poll', true, 5) // Don't show again in next N minutes |
| 2374 | } |
| 2375 | }, 20000) // Don't leave the poll open forever |
| 2376 | } |
| 2377 | } |
| 2378 | |
| 2379 | showPoll () { |
| 2380 | if (!this.shouldShow('poll')) { return false } |
no test coverage detected