mirror of
https://github.com/whippyshou/mastodon
synced 2024-11-25 07:37:08 +09:00
Fix #529 - Make hashtag timelines show conversations, fix hashtag loading in the UI
This commit is contained in:
parent
8ef79d8dc9
commit
bf60f2898d
@ -74,7 +74,7 @@ export function refreshTimeline(timeline, id = null) {
|
|||||||
let path = timeline;
|
let path = timeline;
|
||||||
let skipLoading = false;
|
let skipLoading = false;
|
||||||
|
|
||||||
if (newestId !== null && getState().getIn(['timelines', timeline, 'loaded'])) {
|
if (newestId !== null && getState().getIn(['timelines', timeline, 'loaded']) && (id === null || getState().getIn(['timelines', timeline, 'id']) === id)) {
|
||||||
params = `?since_id=${newestId}`;
|
params = `?since_id=${newestId}`;
|
||||||
skipLoading = true;
|
skipLoading = true;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ export function expandTimeline(timeline, id = null) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(expandTimelineRequest(timeline));
|
dispatch(expandTimelineRequest(timeline, id));
|
||||||
|
|
||||||
let path = timeline;
|
let path = timeline;
|
||||||
|
|
||||||
@ -133,10 +133,11 @@ export function expandTimeline(timeline, id = null) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export function expandTimelineRequest(timeline) {
|
export function expandTimelineRequest(timeline, id) {
|
||||||
return {
|
return {
|
||||||
type: TIMELINE_EXPAND_REQUEST,
|
type: TIMELINE_EXPAND_REQUEST,
|
||||||
timeline
|
timeline,
|
||||||
|
id
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,9 +11,10 @@ import LoadingIndicator from '../../components/loading_indicator';
|
|||||||
import Column from '../ui/components/column';
|
import Column from '../ui/components/column';
|
||||||
import HeaderContainer from './containers/header_container';
|
import HeaderContainer from './containers/header_container';
|
||||||
import ColumnBackButton from '../../components/column_back_button';
|
import ColumnBackButton from '../../components/column_back_button';
|
||||||
|
import Immutable from 'immutable';
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => ({
|
const mapStateToProps = (state, props) => ({
|
||||||
statusIds: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId), 'items']),
|
statusIds: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId), 'items'], Immutable.List()),
|
||||||
isLoading: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId), 'isLoading']),
|
isLoading: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId), 'isLoading']),
|
||||||
me: state.getIn(['meta', 'me'])
|
me: state.getIn(['meta', 'me'])
|
||||||
});
|
});
|
||||||
@ -49,7 +50,7 @@ const AccountTimeline = React.createClass({
|
|||||||
render () {
|
render () {
|
||||||
const { statusIds, isLoading, me } = this.props;
|
const { statusIds, isLoading, me } = this.props;
|
||||||
|
|
||||||
if (!statusIds) {
|
if (!statusIds && isLoading) {
|
||||||
return (
|
return (
|
||||||
<Column>
|
<Column>
|
||||||
<LoadingIndicator />
|
<LoadingIndicator />
|
||||||
|
@ -67,6 +67,7 @@ const Followers = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<Column>
|
<Column>
|
||||||
<ColumnBackButton />
|
<ColumnBackButton />
|
||||||
|
|
||||||
<ScrollContainer scrollKey='followers'>
|
<ScrollContainer scrollKey='followers'>
|
||||||
<div className='scrollable' onScroll={this.handleScroll}>
|
<div className='scrollable' onScroll={this.handleScroll}>
|
||||||
<div>
|
<div>
|
||||||
|
@ -67,6 +67,7 @@ const Following = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<Column>
|
<Column>
|
||||||
<ColumnBackButton />
|
<ColumnBackButton />
|
||||||
|
|
||||||
<ScrollContainer scrollKey='following'>
|
<ScrollContainer scrollKey='following'>
|
||||||
<div className='scrollable' onScroll={this.handleScroll}>
|
<div className='scrollable' onScroll={this.handleScroll}>
|
||||||
<div>
|
<div>
|
||||||
|
@ -119,7 +119,6 @@ class Status < ApplicationRecord
|
|||||||
query = tag.statuses
|
query = tag.statuses
|
||||||
.joins('LEFT OUTER JOIN accounts ON statuses.account_id = accounts.id')
|
.joins('LEFT OUTER JOIN accounts ON statuses.account_id = accounts.id')
|
||||||
.where(visibility: :public)
|
.where(visibility: :public)
|
||||||
.where('(statuses.in_reply_to_id IS NULL OR statuses.in_reply_to_account_id = statuses.account_id)')
|
|
||||||
.where('statuses.reblog_of_id IS NULL')
|
.where('statuses.reblog_of_id IS NULL')
|
||||||
|
|
||||||
account.nil? ? filter_timeline_default(query) : filter_timeline_default(filter_timeline(query, account))
|
account.nil? ? filter_timeline_default(query) : filter_timeline_default(filter_timeline(query, account))
|
||||||
|
@ -8,9 +8,12 @@ class FanOutOnWriteService < BaseService
|
|||||||
deliver_to_followers(status)
|
deliver_to_followers(status)
|
||||||
deliver_to_mentioned(status)
|
deliver_to_mentioned(status)
|
||||||
|
|
||||||
return if status.account.silenced? || !status.public_visibility? || status.reblog? || (status.reply? && status.in_reply_to_account_id != status.account_id)
|
return if status.account.silenced? || !status.public_visibility? || status.reblog?
|
||||||
|
|
||||||
deliver_to_hashtags(status)
|
deliver_to_hashtags(status)
|
||||||
|
|
||||||
|
return if status.reply? && status.in_reply_to_account_id != status.account_id
|
||||||
|
|
||||||
deliver_to_public(status)
|
deliver_to_public(status)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user