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

Method afterInsert

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

Source from the content-addressed store, hash-verified

1121 }
1122
1123 afterInsert () {
1124 super.afterInsert()
1125 const preloadImages = ['/images/pages/base/modal_background.png', '/images/level/popover_background.png', '/images/level/code_palette_wood_background.png', '/images/level/code_editor_background_border.png']
1126 _.delay(() => preloadImages.forEach(img => ($('<img/>')[0].src = img)), 2000)
1127
1128 if (utils.getQueryVariable('signup') && me.get('anonymous')) {
1129 return this.promptForSignup()
1130 }
1131 if (!me.isPremium() && (this.isPremiumCampaign() || (this.options.worldComplete && !features.noAuth && !me.isInHourOfCode()))) {
1132 if (me.get('anonymous')) {
1133 return this.promptForSignup()
1134 }
1135 const campaignSlug = window.location.pathname.split('/')[2]
1136 return this.promptForSubscription(campaignSlug, 'premium campaign visited')
1137 }
1138
1139 this.maybeAutoShowPromotionModal()
1140 }
1141
1142 maybeAutoShowPromotionModal () {
1143 if (

Callers

nothing calls this directly

Calls 7

promptForSignupMethod · 0.95
isPremiumCampaignMethod · 0.95
promptForSubscriptionMethod · 0.95
isPremiumMethod · 0.80
isInHourOfCodeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected