Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #12 from kucrut/issue/11
Browse files Browse the repository at this point in the history
Remember TT-RSS URL
  • Loading branch information
kucrut authored Mar 28, 2017
2 parents 1f3e7e5 + 0567cc8 commit 9dc584c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/components/Article.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class Article extends React.Component {
}

scrollToTop() {
console.log( this.props.mainContent.scrollTop );
this.props.mainContent.scrollTop = 0;
}

Expand Down
3 changes: 2 additions & 1 deletion app/components/LoginForm.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 );
Expand Down
1 change: 1 addition & 0 deletions app/css/common/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pre {
overflow: auto;
border: 1px solid #ddd;
border-radius: 3px;
white-space: pre-wrap;
}

:not(pre) > code,
Expand Down
6 changes: 5 additions & 1 deletion app/reducers/session.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PropTypes } from 'react';
import { get } from 'lodash';
import { get, trimEnd } from 'lodash';
import {
CHECK_SESSION_SUCCESS,
CHECK_SESSION_FAILURE,
Expand All @@ -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 = {
Expand Down

0 comments on commit 9dc584c

Please sign in to comment.