Currently if a branch/tag/PR is in the state of a "build" it returns a disabled "Building..." button. The AJAX event used to "check" the build state only happens when one of us admins does a "rebuild" callback and then it auto checks if json.building value is set and then does it's "check" on a setTimeout():
https://github.com/dreditor/dreditor.org/blob/7.x/sites/all/modules/custom/dreditor_org/js/dreditor_org.js#L105-L125
So if this check isn't initiated by the rebuild callback, the button just appears to say "Building..." until one refreshes the page.
This was done very hastily and it's obviously unstable (not my best work lol).
Solution:
Have a second behavior attachment that detects if there is a build button and instantiate the callback, avoiding the setTimeout entirely.
Currently if a branch/tag/PR is in the state of a "build" it returns a disabled "Building..." button. The AJAX event used to "check" the build state only happens when one of us admins does a "rebuild" callback and then it auto checks if
json.buildingvalue is set and then does it's "check" on asetTimeout():https://github.com/dreditor/dreditor.org/blob/7.x/sites/all/modules/custom/dreditor_org/js/dreditor_org.js#L105-L125
So if this check isn't initiated by the rebuild callback, the button just appears to say "Building..." until one refreshes the page.
This was done very hastily and it's obviously unstable (not my best work lol).
Solution:
Have a second behavior attachment that detects if there is a build button and instantiate the callback, avoiding the
setTimeoutentirely.