Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9a75d867
authored
Nov 01, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
eslint
parent
27fae3ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
store/index.ts
xim/xim.ts
store/index.ts
View file @
9a75d867
...
@@ -31,7 +31,7 @@ function uniqueMessages(
...
@@ -31,7 +31,7 @@ function uniqueMessages(
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
)
{
)
{
const
arr
=
[...
messages
];
const
arr
=
[...
messages
];
return
unique
(
arr
,
function
(
item
,
all
)
{
return
unique
(
arr
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
});
});
}
}
...
@@ -327,7 +327,7 @@ export default {
...
@@ -327,7 +327,7 @@ export default {
state
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
]
=
[...
current
];
state
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
]
=
[...
current
];
}
}
},
},
[
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_INPUTING
]:
(
function
()
{
[
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_INPUTING
]:
(
function
()
{
const
setTimeoutId
:
{
[
key
:
string
]:
number
}
=
{};
const
setTimeoutId
:
{
[
key
:
string
]:
number
}
=
{};
return
(
return
(
state
:
ChatStoreState
,
state
:
ChatStoreState
,
...
@@ -760,7 +760,7 @@ export default {
...
@@ -760,7 +760,7 @@ export default {
}
}
commit
(
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_MEMBERS
,
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_MEMBERS
,
unique
(
newChatMembers
,
function
(
item
,
all
)
{
unique
(
newChatMembers
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
eid
===
item
.
eid
);
return
all
.
findIndex
((
k
)
=>
k
.
eid
===
item
.
eid
);
})
})
);
);
...
...
xim/xim.ts
View file @
9a75d867
...
@@ -108,22 +108,22 @@ export class Xim {
...
@@ -108,22 +108,22 @@ export class Xim {
}
}
public
fetchMsgInBox
(
chatId
:
number
,
msgId
:
number
)
{
public
fetchMsgInBox
(
chatId
:
number
,
msgId
:
number
)
{
if
(
this
.
client
==
null
)
return
;
if
(
this
.
client
==
null
)
return
Promise
.
reject
()
;
return
this
.
client
.
fetchMsgInBox
(
chatType
,
chatId
,
msgId
);
return
this
.
client
.
fetchMsgInBox
(
chatType
,
chatId
,
msgId
);
}
}
public
fetchChatList
()
{
public
fetchChatList
()
{
if
(
this
.
client
==
null
)
return
;
if
(
this
.
client
==
null
)
return
Promise
.
reject
()
;
return
this
.
client
.
fetchChatList
({});
return
this
.
client
.
fetchChatList
({});
}
}
public
fetchChatListAfter
(
lastMsgTs
:
number
)
{
public
fetchChatListAfter
(
lastMsgTs
:
number
)
{
if
(
this
.
client
==
null
)
return
;
if
(
this
.
client
==
null
)
return
Promise
.
reject
()
;
return
this
.
client
.
fetchChatList
({
last_msg_ts
:
lastMsgTs
});
return
this
.
client
.
fetchChatList
({
last_msg_ts
:
lastMsgTs
});
}
}
public
fetchChat
(
chat_id
:
number
)
{
public
fetchChat
(
chat_id
:
number
)
{
if
(
this
.
client
==
null
)
return
;
if
(
this
.
client
==
null
)
return
Promise
.
reject
()
;
return
this
.
client
.
fetchChat
(
chat_id
);
return
this
.
client
.
fetchChat
(
chat_id
);
}
}
...
@@ -137,13 +137,13 @@ export class Xim {
...
@@ -137,13 +137,13 @@ export class Xim {
msg
:
string
msg
:
string
)
{
)
{
this
.
checkConnected
();
this
.
checkConnected
();
if
(
this
.
client
==
null
)
return
;
if
(
this
.
client
==
null
)
return
Promise
.
reject
()
;
return
this
.
client
.
sendMsg
(
chatType
,
chatId
,
msgType
,
msg
,
""
,
{});
return
this
.
client
.
sendMsg
(
chatType
,
chatId
,
msgType
,
msg
,
""
,
{});
}
}
public
inputing
(
chatId
:
number
)
{
public
inputing
(
chatId
:
number
)
{
this
.
checkConnected
();
this
.
checkConnected
();
if
(
this
.
client
==
null
)
return
;
if
(
this
.
client
==
null
)
return
Promise
.
reject
()
;
return
this
.
client
.
userInput
(
chatType
,
chatId
);
return
this
.
client
.
userInput
(
chatType
,
chatId
);
}
}
...
@@ -152,7 +152,7 @@ export class Xim {
...
@@ -152,7 +152,7 @@ export class Xim {
*/
*/
public
fetchChatMembers
(
chat_id
:
number
)
{
public
fetchChatMembers
(
chat_id
:
number
)
{
this
.
checkConnected
();
this
.
checkConnected
();
if
(
this
.
client
==
null
)
return
;
if
(
this
.
client
==
null
)
return
Promise
.
reject
()
;
return
this
.
client
.
fetchChatMembers
(
chat_id
);
return
this
.
client
.
fetchChatMembers
(
chat_id
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment