[Glitch] Add editing for published statuses
Port 63002cde03
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@ -51,6 +51,7 @@ function mapStateToProps (state) {
|
||||
focusDate: state.getIn(['compose', 'focusDate']),
|
||||
caretPosition: state.getIn(['compose', 'caretPosition']),
|
||||
isSubmitting: state.getIn(['compose', 'is_submitting']),
|
||||
isEditing: state.getIn(['compose', 'id']) !== null,
|
||||
isChangingUpload: state.getIn(['compose', 'is_changing_upload']),
|
||||
isUploading: state.getIn(['compose', 'is_uploading']),
|
||||
layout: state.getIn(['local_settings', 'layout']),
|
||||
|
@ -1,14 +1,24 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { cancelReplyCompose } from 'flavours/glitch/actions/compose';
|
||||
import { makeGetStatus } from 'flavours/glitch/selectors';
|
||||
import ReplyIndicator from '../components/reply_indicator';
|
||||
|
||||
function makeMapStateToProps (state) {
|
||||
const inReplyTo = state.getIn(['compose', 'in_reply_to']);
|
||||
const makeMapStateToProps = () => {
|
||||
const mapStateToProps = state => {
|
||||
let statusId = state.getIn(['compose', 'id'], null);
|
||||
let editing = true;
|
||||
|
||||
return {
|
||||
status: inReplyTo ? state.getIn(['statuses', inReplyTo]) : null,
|
||||
if (statusId === null) {
|
||||
statusId = state.getIn(['compose', 'in_reply_to']);
|
||||
editing = false;
|
||||
}
|
||||
|
||||
return {
|
||||
status: state.getIn(['statuses', statusId]),
|
||||
editing,
|
||||
};
|
||||
};
|
||||
|
||||
return mapStateToProps;
|
||||
};
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
Reference in New Issue
Block a user