Fix upgrade handler
This commit is contained in:
		| @@ -46,10 +46,13 @@ export function clickUpgradeButton() { | ||||
| } | ||||
|  | ||||
| export function createUpgradeButton(onClickHandler: (resources: Resources) => void) { | ||||
|     const upgradeContainer = jQuery('.upgradeButtonsContainer .section1'); | ||||
|     if (upgradeContainer.length !== 1) { | ||||
|         return; | ||||
|     } | ||||
|     const id = uniqId(); | ||||
|     jQuery('.upgradeButtonsContainer .section1').append( | ||||
|         `<div style="padding: 8px"><a id="${id}" href="#">В очередь</a></div>` | ||||
|     ); | ||||
|     const btn = `<div style="padding: 8px"><a id="${id}" href="#">В очередь</a></div>`; | ||||
|     upgradeContainer.append(btn); | ||||
|     const resources = grabContractResources(); | ||||
|     jQuery(`#${id}`).on('click', evt => { | ||||
|         evt.preventDefault(); | ||||
|   | ||||
| @@ -31,7 +31,7 @@ export class BuildingPageController { | ||||
|     } | ||||
|  | ||||
|     run() { | ||||
|         const buildTypeId = this.attributes.buildTypeId; | ||||
|         const { buildTypeId } = this.attributes; | ||||
|         this.logger.log('BUILD PAGE DETECTED', 'ID', this.attributes.buildId, 'TYPE', buildTypeId); | ||||
|  | ||||
|         if (buildTypeId) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user