fix(master): linting warnings

This commit is contained in:
Rajeh Taher
2024-05-10 16:33:59 +03:00
committed by GitHub
parent 88cf6f5234
commit ce325d1182
3 changed files with 9 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ export const makeBusinessSocket = (config: SocketConfig) => {
const getCatalog = async({ jid, limit, cursor }: GetCatalogOptions) => {
jid = jid || authState.creds.me?.id
jid = jidNormalizedUser(jid!)
jid = jidNormalizedUser(jid)
const queryParamNodes: BinaryNode[] = [
{
@@ -65,7 +65,7 @@ export const makeBusinessSocket = (config: SocketConfig) => {
const getCollections = async(jid?: string, limit = 51) => {
jid = jid || authState.creds.me?.id
jid = jidNormalizedUser(jid!)
jid = jidNormalizedUser(jid)
const result = await query({
tag: 'iq',
attrs: {

View File

@@ -42,7 +42,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
return key
}
const fetchPrivacySettings = async(force: boolean = false) => {
const fetchPrivacySettings = async(force = false) => {
if(!privacySettings || force) {
const { content } = await query({
tag: 'iq',
@@ -540,7 +540,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
const sendPresenceUpdate = async(type: WAPresence, toJid?: string) => {
const me = authState.creds.me!
if(type === 'available' || type === 'unavailable') {
if(!me!.name) {
if(!me.name) {
logger.warn('no name present, ignoring presence update request...')
return
}
@@ -550,7 +550,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
await sendNode({
tag: 'presence',
attrs: {
name: me!.name,
name: me.name,
type
}
})
@@ -558,7 +558,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
await sendNode({
tag: 'chatstate',
attrs: {
from: me!.id!,
from: me.id,
to: toJid!,
},
content: [
@@ -840,7 +840,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
// update our pushname too
if(msg.key.fromMe && msg.pushName && authState.creds.me?.name !== msg.pushName) {
ev.emit('creds.update', { me: { ...authState.creds.me!, name: msg.pushName! } })
ev.emit('creds.update', { me: { ...authState.creds.me!, name: msg.pushName } })
}
}

View File

@@ -165,8 +165,8 @@ export const makeGroupsSocket = (config: SocketConfig) => {
}]
)
const node = getBinaryNodeChild(result, 'membership_requests_action')
const nodeAction = getBinaryNodeChild(node!, action)
const participantsAffected = getBinaryNodeChildren(nodeAction!, 'participant')
const nodeAction = getBinaryNodeChild(node, action)
const participantsAffected = getBinaryNodeChildren(nodeAction, 'participant')
return participantsAffected.map(p => {
return { status: p.attrs.error || '200', jid: p.attrs.jid }
})