Summary: App.stonehearthClient.openCrafterMenu(…) uses StonehearthTeamCrafterView.job_uri to compare the targetCrafter alias (e.g., “stonehearth:jobs:carpenter”) to the current workshop view’s job_uri property to see if an already-open workshop should be closed when a crafter’s unit frame workshop command button is clicked.
However, StonehearthTeamCrafterView uses job_uri as a “previous uri” variable to compare to ‘uri’ when ‘uri’ ostensibly changes, overwriting it with the value in ‘uri’ (e.g., “object://game/12345”) when the comparison is made. This makes it so the workshop will never close from clicking a crafter’s workshop command button on the unit frame.
Simplest solution: In App.stonehearthClient, change the first line of openCrafterMenu from this:
if (closeIfOpen && App.stonehearth.showTeamWorkshopView && App.stonehearth.showTeamWorkshopView.job_uri == targetCrafter) {
to this:
if (closeIfOpen && App.stonehearth.showTeamWorkshopView && App.stonehearth.showTeamWorkshopView.get('model.alias') == targetCrafter) {
Version Number and Mods in use: latest