chore: minor tweak

This commit is contained in:
AlexAlexandre 2021-12-08 03:10:34 -03:00
parent 475d6be5b0
commit 9519ae50e7
1 changed files with 4 additions and 4 deletions

View File

@ -181,9 +181,9 @@ class RoomView extends React.Component<IRoomViewProps, any> {
private willBlurListener?: { remove(): void }; private willBlurListener?: { remove(): void };
private subSubscription?: { unsubscribe(): void }; private subSubscription?: { unsubscribe(): void };
private queryUnreads?: { unsubscribe(): void }; private queryUnreads?: { unsubscribe(): void };
private retryInit: any; private retryInit?: number;
private retryInitTimeout?: ReturnType<typeof setTimeout>; private retryInitTimeout?: ReturnType<typeof setTimeout>;
private retryFindCount: any; private retryFindCount?: number;
private retryFindTimeout?: ReturnType<typeof setTimeout>; private retryFindTimeout?: ReturnType<typeof setTimeout>;
private messageErrorActions: any; private messageErrorActions: any;
private messageActions: any; private messageActions: any;
@ -563,7 +563,7 @@ class RoomView extends React.Component<IRoomViewProps, any> {
this.setState({ canAutoTranslate, member, loading: false }); this.setState({ canAutoTranslate, member, loading: false });
} catch (e) { } catch (e) {
this.setState({ loading: false }); this.setState({ loading: false });
this.retryInit = this.retryInit + 1 || 1; this.retryInit = this.retryInit! + 1 || 1;
if (this.retryInit <= 1) { if (this.retryInit <= 1) {
this.retryInitTimeout = setTimeout(() => { this.retryInitTimeout = setTimeout(() => {
this.init(); this.init();
@ -611,7 +611,7 @@ class RoomView extends React.Component<IRoomViewProps, any> {
if (this.rid) { if (this.rid) {
// We navigate to RoomView before the Room is inserted to the local db // We navigate to RoomView before the Room is inserted to the local db
// So we retry just to make sure we have the right content // So we retry just to make sure we have the right content
this.retryFindCount = this.retryFindCount + 1 || 1; this.retryFindCount = this.retryFindCount! + 1 || 1;
if (this.retryFindCount <= 3) { if (this.retryFindCount <= 3) {
this.retryFindTimeout = setTimeout(() => { this.retryFindTimeout = setTimeout(() => {
this.findAndObserveRoom(rid); this.findAndObserveRoom(rid);