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.mounted = false;
|
||||||
this.rid = props.route.params?.rid;
|
this.rid = props.route.params?.rid;
|
||||||
this.t = props.route.params?.t;
|
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 = {
|
this.state = {
|
||||||
loading: false,
|
loading: false,
|
||||||
end: false,
|
end: false,
|
||||||
|
@ -134,7 +131,7 @@ class ThreadMessagesView extends React.Component {
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
headerTitleAlign: 'center',
|
headerTitleAlign: 'center',
|
||||||
headerTitle: this.isDiscussion ? this.name : I18n.t('Threads'),
|
headerTitle: I18n.t('Threads'),
|
||||||
headerTitleContainerStyle: {
|
headerTitleContainerStyle: {
|
||||||
left: null,
|
left: null,
|
||||||
right: null
|
right: null
|
||||||
|
@ -299,18 +296,6 @@ class ThreadMessagesView extends React.Component {
|
||||||
|
|
||||||
this.setState({ loading: true });
|
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 {
|
try {
|
||||||
const result = await RocketChat.getThreadsList({
|
const result = await RocketChat.getThreadsList({
|
||||||
rid: this.rid, count: API_FETCH_COUNT, offset: messages.length, text: searchText
|
rid: this.rid, count: API_FETCH_COUNT, offset: messages.length, text: searchText
|
||||||
|
@ -326,7 +311,6 @@ class ThreadMessagesView extends React.Component {
|
||||||
log(e);
|
log(e);
|
||||||
this.setState({ loading: false, end: true });
|
this.setState({ loading: false, end: true });
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, 300)
|
}, 300)
|
||||||
|
|
||||||
// eslint-disable-next-line react/sort-comp
|
// eslint-disable-next-line react/sort-comp
|
||||||
|
@ -450,7 +434,7 @@ class ThreadMessagesView extends React.Component {
|
||||||
|
|
||||||
renderHeader = () => {
|
renderHeader = () => {
|
||||||
const { messages, currentFilter } = this.state;
|
const { messages, currentFilter } = this.state;
|
||||||
if (!messages.length || this.isDiscussion) {
|
if (!messages.length) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,7 +458,7 @@ class ThreadMessagesView extends React.Component {
|
||||||
} else if (currentFilter === FILTER.UNREAD) {
|
} else if (currentFilter === FILTER.UNREAD) {
|
||||||
text = I18n.t('No_threads_unread');
|
text = I18n.t('No_threads_unread');
|
||||||
} else {
|
} else {
|
||||||
text = this.isDiscussion ? I18n.t('No_discussions') : I18n.t('No_threads');
|
text = I18n.t('No_threads');
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
Loading…
Reference in New Issue