Compare commits

..

5 commits

Author SHA1 Message Date
f3803e95f6 Remove leftover references
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/tests Pipeline was successful
2025-03-26 09:59:11 +01:00
b0ec30d18b Fix url usages in templates
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/tests Pipeline failed
2025-03-26 09:54:16 +01:00
bcb98efeca Add missing migrations
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/tests Pipeline failed
2025-03-26 09:47:52 +01:00
497364c126 Remove reddit code
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/tests Pipeline failed
2025-03-26 09:31:04 +01:00
1b0671b34c Initial commit 2025-03-24 09:18:53 +01:00
2 changed files with 108 additions and 105 deletions

View file

@ -3,7 +3,9 @@ import React from 'react';
class Messages extends React.Component {
state = { messages: this.props.messages };
close = (index) => {
close = ::this.close;
close(index) {
const newMessages = this.state.messages.filter((message, currentIndex) => {
return currentIndex != index;
});

View file

@ -7,9 +7,10 @@ import { SAVED_TYPE } from '../constants.js';
import { formatDatetime } from '../../../utils.js';
class PostModal extends React.Component {
readTimer = null;
modalListener = ::this.modalListener;
readTimer = null;
componentDidMount() {
componentDidMount() {
const post = { ...this.props.post };
const markPostRead = this.props.markPostRead;
const token = Cookies.get('csrftoken');
@ -19,9 +20,9 @@ class PostModal extends React.Component {
}
window.addEventListener('click', this.modalListener);
}
}
componentWillUnmount() {
componentWillUnmount() {
if (this.readTimer) {
clearTimeout(this.readTimer);
}
@ -29,17 +30,17 @@ class PostModal extends React.Component {
this.readTimer = null;
window.removeEventListener('click', this.modalListener);
}
}
modalListener = (e) => {
modalListener(e) {
const targetClassName = e.target.className;
if (this.props.post && targetClassName == 'modal post-modal') {
this.props.unSelectPost();
}
}
}
render() {
render() {
const post = this.props.post;
const token = Cookies.get('csrftoken');
const publicationDate = formatDatetime(post.publicationDate);
@ -66,7 +67,7 @@ class PostModal extends React.Component {
<div className="post__actions">
<button
className={`button read-button ${readButtonDisabled &&
'button--disabled'}`}
'button--disabled'}`}
onClick={() =>
!readButtonDisabled && this.props.markPostRead(post, token)
}
@ -131,7 +132,7 @@ class PostModal extends React.Component {
</div>
</div>
);
}
}
}
const mapDispatchToProps = dispatch => ({