diff --git a/res/css/structures/_GenericErrorPage.scss b/res/css/structures/_GenericErrorPage.scss index 9c973af411..44ea73444e 100644 --- a/res/css/structures/_GenericErrorPage.scss +++ b/res/css/structures/_GenericErrorPage.scss @@ -14,6 +14,6 @@ width: 500px; height: 200px; border: 1px solid #f22; - padding: 10px; + padding: 10px 10px 20px; background-color: #fcc; } diff --git a/src/Lifecycle.js b/src/Lifecycle.js index b8494ce9f5..7c78b71f2b 100644 --- a/src/Lifecycle.js +++ b/src/Lifecycle.js @@ -123,7 +123,7 @@ export async function loadSession(opts) { * @returns {String} The persisted session's owner, if an owner exists. Null otherwise. */ export function getStoredSessionOwner() { - const {hsUrl, userId, accessToken} = _getLocalStorageSessionVars(); + const {hsUrl, userId, accessToken} = getLocalStorageSessionVars(); return hsUrl && userId && accessToken ? userId : null; } @@ -132,7 +132,7 @@ export function getStoredSessionOwner() { * for a real user. If there is no stored session, return null. */ export function getStoredSessionIsGuest() { - const sessVars = _getLocalStorageSessionVars(); + const sessVars = getLocalStorageSessionVars(); return sessVars.hsUrl && sessVars.userId && sessVars.accessToken ? sessVars.isGuest : null; } @@ -238,7 +238,12 @@ function _registerAsGuest(hsUrl, isUrl, defaultDeviceDisplayName) { }); } -function _getLocalStorageSessionVars() { +/** + * Retrieves information about the stored session in localstorage. The session + * may not be valid, as it is not tested for consistency here. + * @returns {Object} Information about the session - see implementation for variables. + */ +export function getLocalStorageSessionVars() { const hsUrl = localStorage.getItem("mx_hs_url"); const isUrl = localStorage.getItem("mx_is_url") || 'https://matrix.org'; const accessToken = localStorage.getItem("mx_access_token"); @@ -271,7 +276,7 @@ async function _restoreFromLocalStorage() { return false; } - const {hsUrl, isUrl, accessToken, userId, deviceId, isGuest} = _getLocalStorageSessionVars(); + const {hsUrl, isUrl, accessToken, userId, deviceId, isGuest} = getLocalStorageSessionVars(); if (accessToken && userId && hsUrl) { console.log(`Restoring session for ${userId}`); diff --git a/src/components/structures/GenericErrorPage.js b/src/components/structures/GenericErrorPage.js index f28f66064c..3d8e68cea7 100644 --- a/src/components/structures/GenericErrorPage.js +++ b/src/components/structures/GenericErrorPage.js @@ -20,7 +20,7 @@ import {_t} from "../../languageHandler"; export default class GenericErrorPage extends React.PureComponent { static propTypes = { - message: PropTypes.string.isRequired, + message: PropTypes.object.isRequired, // jsx to display }; render() {