1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Add getSyncStateData()

To get additional information about the sync state (ie. the error
object).
This commit is contained in:
David Baker
2018-08-03 18:00:52 +01:00
parent 04a969b997
commit 89ad104423
2 changed files with 29 additions and 0 deletions

View File

@@ -287,6 +287,21 @@ MatrixClient.prototype.getSyncState = function() {
return this._syncApi.getSyncState();
};
/**
* Returns the additional data object associated with
* the current sync state, or null if there is no
* such data.
* Sync errors, if available, are put in the 'error' key of
* this object.
* @return {?Object}
*/
MatrixClient.prototype.getSyncStateData = function() {
if (!this._syncApi) {
return null;
}
return this._syncApi.getSyncStateData();
};
/**
* Return whether the client is configured for a guest account.
* @return {boolean} True if this is a guest access_token (or no token is supplied).