diff --git a/app/components/Article.jsx b/app/components/Article.jsx index 232d3a4..ae5a61d 100644 --- a/app/components/Article.jsx +++ b/app/components/Article.jsx @@ -96,7 +96,6 @@ class Article extends React.Component { } scrollToTop() { - console.log( this.props.mainContent.scrollTop ); this.props.mainContent.scrollTop = 0; } diff --git a/app/components/LoginForm.jsx b/app/components/LoginForm.jsx index 4faa90d..c19708c 100644 --- a/app/components/LoginForm.jsx +++ b/app/components/LoginForm.jsx @@ -1,4 +1,5 @@ import React, { PropTypes } from 'react'; +import { toString } from 'lodash'; import { requestLogin } from 'actions/session'; import Icon from 'components/Icon'; import styles from 'css/components/form'; @@ -16,7 +17,7 @@ export default class LoginForm extends React.Component { this.state = { user: '', password: '', - url: window.location.origin, + url: toString( localStorage.getItem( 'ttrssBaseUrl' ) ) || window.location.origin, }; this.handleChange = this.handleChange.bind( this ); diff --git a/app/css/common/typography.css b/app/css/common/typography.css index 4e3b75d..f777cf9 100644 --- a/app/css/common/typography.css +++ b/app/css/common/typography.css @@ -30,6 +30,7 @@ pre { overflow: auto; border: 1px solid #ddd; border-radius: 3px; + white-space: pre-wrap; } :not(pre) > code, diff --git a/app/reducers/session.js b/app/reducers/session.js index e8eebb9..9937945 100644 --- a/app/reducers/session.js +++ b/app/reducers/session.js @@ -1,5 +1,5 @@ import { PropTypes } from 'react'; -import { get } from 'lodash'; +import { get, trimEnd } from 'lodash'; import { CHECK_SESSION_SUCCESS, CHECK_SESSION_FAILURE, @@ -19,6 +19,10 @@ const initialState = { function saveSession( url, sid ) { localStorage.setItem( 'ttrssUrl', url ); localStorage.setItem( 'ttrssSid', sid ); + + if ( url ) { + localStorage.setItem( 'ttrssBaseUrl', trimEnd( url, '/api/' ) ); + } } export const sessionShape = {