@@ -17,7 +17,6 @@ import ActivityIndicator from '../../containers/ActivityIndicator';
1717import * as List from '../../containers/List' ;
1818import SearchHeader from '../../containers/SearchHeader' ;
1919import { themes } from '../../lib/constants' ;
20- import { animateNextTransition } from '../../lib/methods/helpers/layoutAnimation' ;
2120import { TSupportedThemes , withTheme } from '../../theme' ;
2221import SafeAreaView from '../../containers/SafeAreaView' ;
2322import { 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