Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/containers/Avatar/useAvatarETag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
}

if (record) {
const observable = record.observe() as Observable<TSubscriptionModel | TUserModel | TLoggedUserModel>;
subscription = observable.subscribe(r => {
const observable = record.observe() as unknown as Observable<TSubscriptionModel | TUserModel | TLoggedUserModel>;
subscription = observable.subscribe((r) => {
setAvatarETag(r.avatarETag);
});
}
Expand All @@ -61,7 +61,7 @@
}
};
}
}, [text]);

Check warning on line 64 in app/containers/Avatar/useAvatarETag.ts

View workflow job for this annotation

GitHub Actions / format

React Hook useEffect has missing dependencies: 'avatarETag', 'id', 'isDirect', 'rid', and 'username'. Either include them or remove the dependency array

Check warning on line 64 in app/containers/Avatar/useAvatarETag.ts

View workflow job for this annotation

GitHub Actions / ESLint and Test / run-eslint-and-test

React Hook useEffect has missing dependencies: 'avatarETag', 'id', 'isDirect', 'rid', and 'username'. Either include them or remove the dependency array

return { avatarETag };
};
4 changes: 2 additions & 2 deletions app/containers/MessageActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
try {
const db = database.active;
const result = await markAsUnread({ messageId });
if (result.success) {
if (result) {
const subRecord = await getSubscriptionByRoomId(rid);
if (!subRecord) {
return;
Expand Down Expand Up @@ -292,7 +292,7 @@
const handleReplyInDM = async (message: TAnyMessageModel) => {
if (message?.u?.username) {
const result = await createDirectMessage(message.u.username);
if (result.success) {
if (result) {
const { room } = result;
const params = {
rid: room.rid,
Expand Down Expand Up @@ -393,7 +393,7 @@
});
};

const getOptions = (message: TAnyMessageModel) => {

Check warning on line 396 in app/containers/MessageActions/index.tsx

View workflow job for this annotation

GitHub Actions / format

Arrow function has a complexity of 32. Maximum allowed is 31

Check warning on line 396 in app/containers/MessageActions/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint and Test / run-eslint-and-test

Arrow function has a complexity of 32. Maximum allowed is 31
const options: TActionSheetOptionsItem[] = [];
const videoConfBlock = message.t === 'videoconf';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TouchableWithoutFeedback } from 'react-native-gesture-handler';
import { StyleSheet, Text } from 'react-native';
import React, { useEffect, useRef } from 'react';
import { type Subscription } from 'rxjs';
import { Subscription } from 'rxjs/internal/Subscription';

Check failure on line 4 in app/containers/MessageComposer/components/SendThreadToChannel.tsx

View workflow job for this annotation

GitHub Actions / ESLint and Test / run-eslint-and-test

All imports in the declaration are only used as types. Use `import type`
import { Q } from '@nozbe/watermelondb';

import { useRoomContext } from '../../../views/RoomView/context';
Expand Down Expand Up @@ -55,6 +55,7 @@
if (alsoSendThreadToChannelUserPref === 'default') {
const db = database.active;
const observable = db.get('threads').query(Q.where('id', tmid)).observe();
// @ts-ignore: fix me
subscription.current = observable.subscribe(result => {
setAlsoSendThreadToChannel(!result.length);
});
Expand Down
4 changes: 2 additions & 2 deletions app/containers/MessageComposer/hooks/useAutocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const useAutocomplete = ({
return;
}
const response = await getCommandPreview(text, rid, commandParams);
if (response.success) {
if (response.preview) {
const previewItems = (response.preview?.items || []).map(item => ({
id: item.id,
preview: item,
Expand All @@ -176,7 +176,7 @@ export const useAutocomplete = ({
}
if (type === '!') {
const res = await getListCannedResponse({ text });
if (res.success) {
if (res.cannedResponses) {
if (res.cannedResponses.length === 0) {
setItems([
{
Expand Down
4 changes: 1 addition & 3 deletions app/containers/TwoFactor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,9 @@
try {
if (params?.user) {
clearErrors();
const response = await sendEmailCode(params?.user);

Check failure on line 96 in app/containers/TwoFactor/index.tsx

View workflow job for this annotation

GitHub Actions / format

'response' is assigned a value but never used

Check failure on line 96 in app/containers/TwoFactor/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint and Test / run-eslint-and-test

'response' is assigned a value but never used

if (response.success) {
showToast(I18n.t('Two_Factor_Success_message'));
}
showToast(I18n.t('Two_Factor_Success_message'));
}
} catch (e) {
log(e);
Expand Down
4 changes: 2 additions & 2 deletions app/ee/omnichannel/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export const changeLivechatStatus = () => sdk.methodCallWrapper('livechat:change
// @ts-ignore
export const getInquiriesQueued = (serverVersion: string) => {
const url = compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '7.0.0')
? 'livechat/inquiries.queuedForUser'
: 'livechat/inquiries.queued';
? '/v1/livechat/inquiries.queuedForUser'
: '/v1/livechat/inquiries.queued';
return sdk.get(url);
};

Expand Down
6 changes: 3 additions & 3 deletions app/lib/methods/getSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export async function setSettings(): Promise<void> {
reduxStore.dispatch(addSettings(parseSettings(parsed.slice(0, parsed.length))));
}

export function subscribeSettings(): void {
export function subscribeSettings() {
return sdk.subscribe('stream-notify-all', 'public-settings-changed');
}

Expand All @@ -159,8 +159,8 @@ export async function getSettings(): Promise<void> {
let settings: IData[] = [];
const serverVersion = reduxStore.getState().server.version;
const url = compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '7.0.0')
? `${sdk.current.client.host}/api/v1/settings.public?_id=${settingsParams.join(',')}`
: `${sdk.current.client.host}/api/v1/settings.public?query={"_id":{"$in":${JSON.stringify(settingsParams)}}}`;
? `${sdk.current?.connection.url}/api/v1/settings.public?_id=${settingsParams.join(',')}`
: `${sdk.current?.connection.url}/api/v1/settings.public?query={"_id":{"$in":${JSON.stringify(settingsParams)}}}`;
// Iterate over paginated results to retrieve all settings
do {
// TODO: why is no-await-in-loop enforced in the first place?
Expand Down
Loading
Loading