This commit is contained in:
mgabdev 2020-05-14 23:36:10 -04:00
parent a1977ba450
commit 805012ab72
13 changed files with 27 additions and 16 deletions

View File

@ -81,11 +81,11 @@ export const ensureComposeIsVisible = (getState, routerHistory) => {
}
};
export function changeCompose(text, markdown, replyId) {
export function changeCompose(text, markdown, replyId, isStandalone) {
return function (dispatch, getState) {
const reduxReplyToId = getState().getIn(['compose', 'in_reply_to'])
const existingText = getState().getIn(['compose', 'text']).trim()
const isModalOpen = getState().getIn(['modal', 'modalType']) === 'COMPOSE'
const isModalOpen = getState().getIn(['modal', 'modalType']) === 'COMPOSE' || isStandalone
let status
if (!!replyId) {
@ -299,7 +299,7 @@ export function submitCompose(group, replyToId = null, router) {
const scheduled_at = getState().getIn(['compose', 'scheduled_at'], null);
if (scheduled_at !== null) scheduled_at = moment.utc(scheduled_at).toDate();
if (isMobile(window)) {
if (isMobile(window.innerWidth) && router) {
router.history.goBack()
}

View File

@ -157,7 +157,7 @@ export function expandNotifications({ maxId } = {}, done = noOp) {
return;
}
console.log("activeFilter:", activeFilter)
// console.log("activeFilter:", activeFilter)
const params = {
max_id: maxId,

View File

@ -21,8 +21,7 @@ class ProPanel extends PureComponent {
render() {
const { intl, isPro } = this.props
// : todo :
// if (isPro) return null
if (isPro) return null
return (
<PanelLayout

View File

@ -14,6 +14,7 @@ import {
deleteStatus,
editStatus,
} from '../../actions/statuses';
import { quoteCompose } from '../../actions/compose'
import {
fetchGroupRelationships,
createRemovedAccount,
@ -257,6 +258,10 @@ class StatusOptionsPopover extends ImmutablePureComponent {
this.props.onRepost(this.props.status, e)
}
handleQuoteClick = (e) => {
this.props.onQuote(this.props.status, this.context.router)
}
render() {
const {
status,
@ -293,7 +298,7 @@ class StatusOptionsPopover extends ImmutablePureComponent {
icon: 'pencil',
hideArrow: true,
title: intl.formatMessage(messages.repostWithComment),
onClick: this.handleRepostClick,
onClick: this.handleQuoteClick,
})
}

View File

@ -177,7 +177,7 @@ class Status extends ImmutablePureComponent {
if (snapshot !== null && this.props.updateScrollBottom) {
if (this.node && this.node.offsetTop < snapshot.top) {
console.log("updateScrollBottom")
// console.log("updateScrollBottom")
this.props.updateScrollBottom(snapshot.height - snapshot.top)
}
}

View File

@ -123,7 +123,7 @@ class StatusList extends ImmutablePureComponent {
}
fetchContextsForInitialStatuses = (statusIds) => {
console.log("fetchContextsForInitialStatuses:", statusIds)
// console.log("fetchContextsForInitialStatuses:", statusIds)
for (let i = 0; i < statusIds.length; i++) {
const statusId = statusIds[i];
this.props.onFetchContext(statusId)

View File

@ -41,6 +41,10 @@ export default
@injectIntl
class ComposeForm extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
}
state = {
composeFocused: false,
}

View File

@ -28,6 +28,9 @@ const mapStateToProps = (state, { replyToId, isStandalone }) => {
if (isModalOpen) isMatch = true
// console.log("isMatch:", isMatch, reduxReplyToId, replyToId, state.getIn(['compose', 'text']))
// console.log("reduxReplyToId:", reduxReplyToId, isModalOpen, isStandalone)
if (!isMatch) {
return {
isMatch,
@ -81,10 +84,10 @@ const mapStateToProps = (state, { replyToId, isStandalone }) => {
}
}
const mapDispatchToProps = (dispatch, { reduxReplyToId, replyToId }) => ({
const mapDispatchToProps = (dispatch, { reduxReplyToId, replyToId, isStandalone }) => ({
onChange(text, markdown, newReplyToId) {
dispatch(changeCompose(text, markdown, newReplyToId))
dispatch(changeCompose(text, markdown, newReplyToId, isStandalone))
},
onSubmit(group, replyToId, router) {

View File

@ -71,7 +71,7 @@ class ListTimeline extends ImmutablePureComponent {
}
handleEditClick = () => {
console.log("handleEditClick:", this.props.params.id)
// console.log("handleEditClick:", this.props.params.id)
this.props.dispatch(openModal('LIST_EDITOR', { id: this.props.params.id }))
}

View File

@ -117,7 +117,7 @@ class Notifications extends ImmutablePureComponent {
// : todo : include follow requests
console.log('--0--notifications:', hasMore)
// console.log('--0--notifications:', hasMore)
if (isLoading && this.scrollableContent) {
scrollableContent = this.scrollableContent

View File

@ -37,7 +37,7 @@ class Search extends ImmutablePureComponent {
const { results, location } = this.props
const { isSmallScreen } = this.state
console.log("results:", results)
// console.log("results:", results)
if (results.isEmpty() && isSmallScreen) {
return null

View File

@ -146,7 +146,7 @@ class SwitchingArea extends PureComponent {
<Redirect from='/' to='/home' exact />
<WrappedRoute path='/home' exact page={HomePage} component={HomeTimeline} content={children} />
<WrappedRoute path='/compose' exact page={BasicPage} component={Compose} content={children} componentParams={{ title: 'Gab' }} />
<WrappedRoute path='/compose' exact page={BasicPage} component={Compose} content={children} componentParams={{ title: 'Compose' }} />
<WrappedRoute path='/timeline/all' exact page={CommunityPage} component={CommunityTimeline} content={children} componentParams={{ title: 'Community Feed' }} />

View File

@ -173,7 +173,7 @@ const insertEmoji = (state, position, emojiData, needsSpace) => {
const oldText = state.get('text')
const emoji = needsSpace ? ' ' + emojiData.native : emojiData.native
const text = `${oldText.slice(0, position)}${emoji} ${oldText.slice(position)}`
console.log("insertEmoji reducer:", emoji, position, emojiData, needsSpace, text)
// console.log("insertEmoji reducer:", emoji, position, emojiData, needsSpace, text)
return state.merge({
text,