first cut of improving UX for deleting devices.

This adds a 5 minute auth cache to speed up the process of deleting
old devices.  It has the following nastinesses (mainly due to being
written on a flight whilst juggling kids):
 * the auth cache is done as context attached to MatrixChat.
   one could argue that it should be per-client instead, but we don't
   yet have multiple clients.
 * the auth cache is only maintained currently in DevicesPanelEntry
   (i.e. set & invalidated).  One could argue that it might be better
   maintained in InteractiveAuth.js or a dedicated cache object
   abstraction, but given the only use I can think of is when managing
   devices, perhaps this is good enough for now.
This commit is contained in:
Matthew Hodgson 2017-02-21 00:19:49 +00:00
parent 7d07e7f958
commit 6af0b9618a
2 changed files with 24 additions and 5 deletions

View file

@ -68,6 +68,7 @@ module.exports = React.createClass({
childContextTypes: {
appConfig: React.PropTypes.object,
authCache: React.PropTypes.object,
},
AuxPanel: {
@ -77,6 +78,10 @@ module.exports = React.createClass({
getChildContext: function() {
return {
appConfig: this.props.config,
authCache: {
auth: {},
lastUpdate: 0,
},
};
},