MCPcopy Index your code
hub / github.com/codecombat/codecombat / setProjection

Method setProjection

app/models/CocoModel.js:69–80  ·  view source on GitHub ↗
(project)

Source from the content-addressed store, hash-verified

67 // if fixed, RevertModal will also need the fix
68
69 setProjection (project) {
70 // TODO: ends up getting done twice, since the URL is modified and the @project is modified. So don't do this, just set project directly... (?)
71 if (project === this.project) { return }
72 let url = this.getURL()
73 if (!/project=/.test(url)) { url += '&project=' }
74 if (!/\?/.test(url)) { url = url.replace('&', '?') }
75 url = url.replace(/project=[^&]*/, `project=${(project != null ? project.join(',') : undefined) || ''}`)
76 if (!(project != null ? project.length : undefined)) { url = url.replace(/[&?]project=&/, '&') }
77 if (!(project != null ? project.length : undefined)) { url = url.replace(/[&?]project=$/, '') }
78 this.setURL(url)
79 this.project = project
80 }
81
82 type () {
83 return this.constructor.className

Callers 6

initializeMethod · 0.95
CocoModel.spec.jsFile · 0.45
loadThangTypeNamesMethod · 0.45
initializeMethod · 0.45
constructorMethod · 0.45

Calls 2

getURLMethod · 0.95
setURLMethod · 0.95

Tested by

no test coverage detected