| 105 | } |
| 106 | |
| 107 | onClickSwitchTeam (e) { |
| 108 | const protocol = window.location.protocol + '//' |
| 109 | const host = window.location.host |
| 110 | const pathname = window.location.pathname |
| 111 | let query = window.location.search |
| 112 | query = query.replace(/team=[^&]*&?/, '') |
| 113 | if (query) { |
| 114 | if (query.endsWith('?') || query.endsWith('&')) { |
| 115 | query += 'team=' |
| 116 | } else { |
| 117 | query += '&team=' |
| 118 | } |
| 119 | } else { |
| 120 | query = '?team=' |
| 121 | } |
| 122 | window.location.href = protocol + host + pathname + query + this.otherTeam() |
| 123 | } |
| 124 | |
| 125 | otherTeam () { |
| 126 | const teams = _.without(['humans', 'ogres'], this.options.team) |