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
62ac38f4
authored
Dec 22, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
u
parent
95796600
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
store/index.ts
store/index.ts
View file @
62ac38f4
...
...
@@ -32,7 +32,7 @@ function uniqueMessages(
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
)
{
const
arr
=
[...
messages
];
return
unique
(
arr
,
function
(
item
,
all
)
{
return
unique
(
arr
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
});
}
...
...
@@ -259,10 +259,10 @@ export default {
data
:
ChatStore
.
STATE_CHAT_MSG_HISTORY
)
{
const
old
=
state
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
]
||
[];
const
chat
i
d
=
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
];
if
(
chatid
==
null
)
return
;
const
chat
I
d
=
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
];
if
(
!
chatId
)
return
;
state
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
]
=
Object
.
freeze
(
filterMessages
([...(
data
||
[]),
...
old
],
chat
i
d
)
filterMessages
([...(
data
||
[]),
...
old
],
chat
I
d
)
);
},
[
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_MEMBERS
](
...
...
@@ -362,14 +362,14 @@ export default {
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
}
=
{};
return
(
state
:
ChatStoreState
,
payload
:
Parameters
<
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_INPUTING
>
[
0
]
)
=>
{
const
chatId
=
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
];
if
(
chatId
==
null
)
return
;
if
(
!
chatId
)
return
;
if
(
payload
.
chat_id
!==
chatId
)
return
;
const
arr
=
state
[
ChatStore
.
STATE_CURRENT_CHAT_INPUTING
];
const
eid
=
payload
.
eid
;
...
...
@@ -411,8 +411,8 @@ export default {
},
[
ChatStore
.
MUTATION_WITHDRAW
]:
(
state
,
ids
:
number
[])
=>
{
const
old
=
state
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
]
||
[];
const
chat
i
d
=
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
];
if
(
chatid
==
null
)
return
;
const
chat
I
d
=
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
];
if
(
!
chatId
)
return
;
state
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
]
=
old
.
filter
(
(
i
)
=>
!
ids
.
includes
(
i
.
id
)
);
...
...
@@ -563,7 +563,7 @@ export default {
ChatStore
.
GETTER_CURRENT_CURRENT_CHAT
]
as
ChatType
;
const
isMember
=
state
[
ChatStore
.
STATE_CHAT_CURRENT_IS_CHAT_MEMBER
];
if
(
chatId
==
null
)
return
;
if
(
!
chatId
)
return
;
let
data
:
Message
[]
=
[];
const
getMessages
=
async
()
=>
{
const
o
=
{
...
...
@@ -600,7 +600,7 @@ export default {
msgId
:
Parameters
<
ChatStore
.
ACTION_GET_CHAT_MESSAGES_BEFORE_SPECIFIC_ID
>
[
0
]
)
{
const
chatId
=
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
];
if
(
chatId
==
null
)
return
;
if
(
!
chatId
)
return
;
const
chat
=
getters
[
ChatStore
.
GETTER_CURRENT_CURRENT_CHAT
]
as
ChatType
;
...
...
@@ -625,7 +625,7 @@ export default {
msgId
:
Parameters
<
ChatStore
.
ACTION_GET_CHAT_MESSAGES_AFTER_SPECIFIC_ID
>
[
0
]
)
{
const
chatId
=
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
];
if
(
chatId
==
null
)
return
;
if
(
!
chatId
)
return
;
const
chat
=
getters
[
ChatStore
.
GETTER_CURRENT_CURRENT_CHAT
]
as
ChatType
;
...
...
@@ -931,7 +931,7 @@ export default {
}
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_MEMBERS
,
unique
(
newChatMembers
,
function
(
item
,
all
)
{
unique
(
newChatMembers
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
eid
===
item
.
eid
);
})
);
...
...
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