Commit Graph

11 Commits (b2aad4afb10eb6d65ba6ee1023dff29f3951e0d8)

Author SHA1 Message Date
Jason Robinson 02ff1763a2 Ensure scalar_token is valid before opening integrations manager
Since Scalar (and other integration managers) are loaded as apps into
an iframe, a valid `scalar_token` must exist when loading the app.

It is possible that a scalar_token becomes invalid between the time
when the integration manager button was rendered and the user clicking
the link. Here we make a call to integration manager `/account`
before trying to render the integration manager, which ensures we
have a valid token for the integration manager to work with.

Moving the scalar token revalidation to the cases where it is actually
needed could make it possible to decrease the amount of Scalar /account
calls we do when switching rooms, which is currently 3.

Signed-off-by: Jason Robinson <jasonr@matrix.org>
2019-03-13 11:47:00 +02:00
Richard Lewis 20cbc01698 Add callback handler for integration manager close. 2018-03-29 18:32:49 +01:00
Richard Lewis 5ba18b5ee2 Avoid redefining function parameter 2018-03-29 18:13:23 +01:00
Richard Lewis 3d9bdb90ca Consistent async / await / promises. 2018-03-29 17:56:12 +01:00
Richard Lewis b4e70e30f3 Expects object, not naked ID. 2018-03-28 19:21:49 +01:00
Richard Lewis b529edb5cc Linting 2018-03-06 11:02:36 +00:00
Richard Lewis d5465cf2fa Prefix and clarify global variable naming. 2018-03-06 10:55:59 +00:00
Richard Lewis b64736aa44 Add listener to close stickerpicker. 2018-02-26 13:43:16 +00:00
Richard Lewis 73c8ef50d1 Fix current roomID. 2018-02-26 13:37:53 +00:00
Richard Lewis 707e3f3382 Temp. revert unintended commit. 2018-02-26 13:32:27 +00:00
Richard Lewis d3de44e6eb Global interface to start integration manager. 2018-02-26 13:26:49 +00:00