on-disable

On This Page

    Use the on-disable capability to run some code, perhaps to update your records or clean up, when a user disables your Power-Up on a board via the UI.

    Trello will call this capability if you have it enabled and implemented when the user clicks Disable from the gear menu for your Power-Up.

    Your Power-Up will have 500ms to make additional requests of Trello once this capability is called before it is fully disabled, and Trello will stop responding to requests from your Power-Up.

    Not Guaranteed

    Your Power-Up is not guaranteed to have this capability called when it is disabled. This can happen for a few reasons:

    • Power-Up is disabled via the API, instead of via the UI

    • User downgrades, causing them to be over their Power-Up limit, and some Power-Ups will eventually be automatically disabled

    • Your Power-Up failed to load during the session the user disabled it

    Example Code

    1
    2
    window.TrelloPowerUp.initialize({
      'on-disable': function(t){
        // load the data from Trello quickly first in case we need
        // to use any of it to cleanup on our side
        return t.getAll()
        .then(function(data) {
          // here we might want to properly revoke a token
          // or call into our own service to remove some records
        })
      }
    });
    

    Rate this page: