Skip to content

Commit cc773fe

Browse files
authored
chore: Remove layout animation (#6564)
1 parent 951864b commit cc773fe

File tree

6 files changed

+8
-50
lines changed

6 files changed

+8
-50
lines changed

app/lib/methods/helpers/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export * from './deviceInfo';
55
export * from './formatAttachmentUrl';
66
export * from './generateLoadMoreId';
77
export * from './getAvatarUrl';
8-
export * from './layoutAnimation';
98
export * from './info';
109
export * from './isReadOnly';
1110
export * from './media';

app/lib/methods/helpers/layoutAnimation.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/views/AddExistingChannelView/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import * as HeaderButton from '../../containers/Header/components/HeaderButton';
1414
import { useTheme } from '../../theme';
1515
import SafeAreaView from '../../containers/SafeAreaView';
1616
import { sendLoadingEvent } from '../../containers/Loading';
17-
import { animateNextTransition } from '../../lib/methods/helpers/layoutAnimation';
1817
import { showErrorAlert } from '../../lib/methods/helpers/info';
1918
import { ChatsStackParamList } from '../../stacks/types';
2019
import { TSubscriptionModel, SubscriptionType } from '../../definitions';
@@ -123,7 +122,6 @@ const AddExistingChannelView = () => {
123122
const isChecked = (rid: string) => selected.includes(rid);
124123

125124
const toggleChannel = (rid: string) => {
126-
animateNextTransition();
127125
if (!isChecked(rid)) {
128126
logEvent(events.AEC_ADD_CHANNEL);
129127
setSelected([...selected, rid]);

app/views/RoomView/List/hooks/useMessages.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { TAnyMessageModel } from '../../../../definitions';
66
import database from '../../../../lib/database';
77
import { getMessageById } from '../../../../lib/database/services/Message';
88
import { getThreadById } from '../../../../lib/database/services/Thread';
9-
import { animateNextTransition, compareServerVersion, isIOS, useDebounce } from '../../../../lib/methods/helpers';
9+
import { compareServerVersion, useDebounce } from '../../../../lib/methods/helpers';
1010
import { Services } from '../../../../lib/services';
1111
import { QUERY_SIZE } from '../constants';
1212

@@ -81,9 +81,6 @@ export const useMessages = ({
8181
}
8282

8383
readThread();
84-
if (isIOS) {
85-
animateNextTransition();
86-
}
8784
setMessages(newMessages);
8885
messagesIds.current = newMessages.map(m => m.id);
8986
});

app/views/SelectListView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import * as HeaderButton from '../containers/Header/components/HeaderButton';
1212
import { themes } from '../lib/constants';
1313
import { TSupportedThemes, withTheme } from '../theme';
1414
import SafeAreaView from '../containers/SafeAreaView';
15-
import { animateNextTransition } from '../lib/methods/helpers/layoutAnimation';
1615
import { ICON_SIZE } from '../containers/List/constants';
1716
import SearchBox from '../containers/SearchBox';
1817
import Radio from '../containers/Radio';
@@ -126,7 +125,6 @@ class SelectListView extends React.Component<ISelectListViewProps, ISelectListVi
126125
toggleItem = (rid: string) => {
127126
const { selected } = this.state;
128127

129-
animateNextTransition();
130128
if (this.isRadio) {
131129
if (!this.isChecked(rid)) {
132130
this.setState({ selected: [rid] }, () => this.setHeader());

app/views/ShareListView/index.tsx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import ActivityIndicator from '../../containers/ActivityIndicator';
1717
import * as List from '../../containers/List';
1818
import SearchHeader from '../../containers/SearchHeader';
1919
import { themes } from '../../lib/constants';
20-
import { animateNextTransition } from '../../lib/methods/helpers/layoutAnimation';
2120
import { TSupportedThemes, withTheme } from '../../theme';
2221
import SafeAreaView from '../../containers/SafeAreaView';
2322
import { sanitizeLikeString } from '../../lib/database/utils';
@@ -218,15 +217,6 @@ class ShareListView extends React.Component<IShareListViewProps, IState> {
218217
});
219218
};
220219

221-
internalSetState = (...args: object[]) => {
222-
const { navigation } = this.props;
223-
if (navigation.isFocused()) {
224-
animateNextTransition();
225-
}
226-
// @ts-ignore
227-
this.setState(...args);
228-
};
229-
230220
query = async (text?: string) => {
231221
const db = database.active;
232222
const defaultWhereClause = [
@@ -275,19 +265,19 @@ class ShareListView extends React.Component<IShareListViewProps, IState> {
275265
}
276266

277267
if (server) {
278-
const chats = await this.query();
268+
const chats = (await this.query()) as TSubscriptionModel[];
279269
const serversDB = database.servers;
280270
const serversCollection = serversDB.get('servers');
281271
const serversCount = await serversCollection.query(Q.where('rooms_updated_at', Q.notEq(null))).fetchCount();
282-
let serverInfo = {};
272+
let serverInfo = {} as TServerModel;
283273
try {
284274
serverInfo = await serversCollection.find(server);
285275
} catch (error) {
286276
// Do nothing
287277
}
288278

289279
if (this.airGappedReadOnly) {
290-
this.internalSetState({
280+
this.setState({
291281
chats: [],
292282
serversCount,
293283
loading: false,
@@ -297,7 +287,7 @@ class ShareListView extends React.Component<IShareListViewProps, IState> {
297287
return;
298288
}
299289

300-
this.internalSetState({
290+
this.setState({
301291
chats: chats ?? [],
302292
serversCount,
303293
loading: false,
@@ -328,8 +318,8 @@ class ShareListView extends React.Component<IShareListViewProps, IState> {
328318
};
329319

330320
search = async (text: string) => {
331-
const result = await this.query(text);
332-
this.internalSetState({
321+
const result = (await this.query(text)) as TSubscriptionModel[];
322+
this.setState({
333323
searchResults: result,
334324
searchText: text
335325
});
@@ -341,7 +331,7 @@ class ShareListView extends React.Component<IShareListViewProps, IState> {
341331
};
342332

343333
cancelSearch = () => {
344-
this.internalSetState({ searching: false, searchResults: [], searchText: '' }, () => this.setHeader());
334+
this.setState({ searching: false, searchResults: [], searchText: '' }, () => this.setHeader());
345335
Keyboard.dismiss();
346336
};
347337

0 commit comments

Comments
 (0)