Remove old changes from ThreadMessagesView
This commit is contained in:
parent
9ad45f067c
commit
fc59b7426c
|
@ -55,9 +55,6 @@ class ThreadMessagesView extends React.Component {
|
|||
this.mounted = false;
|
||||
this.rid = props.route.params?.rid;
|
||||
this.t = props.route.params?.t;
|
||||
this.name = props.route.params?.name;
|
||||
this.isDiscussion = props.route.params?.isDiscussion;
|
||||
this.prid = props.route.params?.prid;
|
||||
this.state = {
|
||||
loading: false,
|
||||
end: false,
|
||||
|
@ -134,7 +131,7 @@ class ThreadMessagesView extends React.Component {
|
|||
/>
|
||||
),
|
||||
headerTitleAlign: 'center',
|
||||
headerTitle: this.isDiscussion ? this.name : I18n.t('Threads'),
|
||||
headerTitle: I18n.t('Threads'),
|
||||
headerTitleContainerStyle: {
|
||||
left: null,
|
||||
right: null
|
||||
|
@ -299,18 +296,6 @@ class ThreadMessagesView extends React.Component {
|
|||
|
||||
this.setState({ loading: true });
|
||||
|
||||
if (this.isDiscussion) {
|
||||
try {
|
||||
const db = database.active;
|
||||
const subCollection = db.get('subscriptions');
|
||||
const discussions = await subCollection.query(
|
||||
Q.where('prid', Q.eq(this.prid))
|
||||
);
|
||||
this.setState({ loading: false, displayingThreads: discussions });
|
||||
} catch (e) {
|
||||
log(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
const result = await RocketChat.getThreadsList({
|
||||
rid: this.rid, count: API_FETCH_COUNT, offset: messages.length, text: searchText
|
||||
|
@ -326,7 +311,6 @@ class ThreadMessagesView extends React.Component {
|
|||
log(e);
|
||||
this.setState({ loading: false, end: true });
|
||||
}
|
||||
}
|
||||
}, 300)
|
||||
|
||||
// eslint-disable-next-line react/sort-comp
|
||||
|
@ -450,7 +434,7 @@ class ThreadMessagesView extends React.Component {
|
|||
|
||||
renderHeader = () => {
|
||||
const { messages, currentFilter } = this.state;
|
||||
if (!messages.length || this.isDiscussion) {
|
||||
if (!messages.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -474,7 +458,7 @@ class ThreadMessagesView extends React.Component {
|
|||
} else if (currentFilter === FILTER.UNREAD) {
|
||||
text = I18n.t('No_threads_unread');
|
||||
} else {
|
||||
text = this.isDiscussion ? I18n.t('No_discussions') : I18n.t('No_threads');
|
||||
text = I18n.t('No_threads');
|
||||
}
|
||||
return (
|
||||
<>
|
||||
|
|
Loading…
Reference in New Issue