Enable/disable auto marking based on user setting

This commit is contained in:
Sonny Bakker 2020-10-29 22:52:53 +01:00
parent 2b76c560c2
commit d60b01faa3
3 changed files with 3 additions and 2 deletions

View file

@ -40,6 +40,7 @@ class App extends React.Component {
timelineUrl={this.props.timelineUrl} timelineUrl={this.props.timelineUrl}
categoriesUrl={this.props.categoriesUrl} categoriesUrl={this.props.categoriesUrl}
timezone={this.props.timezone} timezone={this.props.timezone}
autoMarking={this.props.autoMarking}
/> />
)} )}
</> </>

View file

@ -21,8 +21,7 @@ class PostModal extends React.Component {
const markPostRead = this.props.markPostRead; const markPostRead = this.props.markPostRead;
const token = Cookies.get('csrftoken'); const token = Cookies.get('csrftoken');
// TODO set timer depending on user setting if (this.props.autoMarking && !post.read) {
if (!post.read) {
this.readTimer = setTimeout(markPostRead, 3000, post, token); this.readTimer = setTimeout(markPostRead, 3000, post, token);
} }

View file

@ -22,6 +22,7 @@ if (page) {
timelineUrl={timelineUrl.substring(1, timelineUrl.length - 4)} timelineUrl={timelineUrl.substring(1, timelineUrl.length - 4)}
categoriesUrl={categoriesUrl.substring(1, categoriesUrl.length - 4)} categoriesUrl={categoriesUrl.substring(1, categoriesUrl.length - 4)}
timezone={settings.timezone} timezone={settings.timezone}
autoMarking={settings.autoMarking}
/> />
</Provider>, </Provider>,
page page