mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
添加站内消息,修复讨论节点丢失的问题
This commit is contained in:
1 parent
33e277f28f
commit
627e64a901
44 files changed
+582
-540
No files matched your search
@@ -78,10 +78,9 @@ export default function (env = {}) {
|
||||
|
||||
const config = {
|
||||
bail: true,
|
||||
mode: 'production',
|
||||
mode: env.production ? 'production' : 'development',
|
||||
profile: true,
|
||||
context: root(),
|
||||
devtool: env.production ? 'source-map' : false,
|
||||
entry: {
|
||||
vj4: './Entry.js',
|
||||
},
|
||||
|
||||
@@ -56,11 +56,11 @@ export default class MessagePadDialogueContentContainer extends React.PureCompon
|
||||
return _.map(this.props.item.reply, (reply, idx) => (
|
||||
<Message
|
||||
key={idx}
|
||||
isSelf={reply.sender_uid === UserContext.uid}
|
||||
isSelf={reply.from === UserContext.uid}
|
||||
faceUrl={
|
||||
reply.sender_uid === this.props.item.sender_uid
|
||||
? this.props.item.sender_udoc.gravatar_url
|
||||
: this.props.item.sendee_udoc.gravatar_url
|
||||
reply.from === this.props.item.from
|
||||
? this.props.item.from_udoc.gravatar_url
|
||||
: this.props.item.to_udoc.gravatar_url
|
||||
}
|
||||
>
|
||||
<div>{reply.content}</div>
|
||||
|
||||
@@ -39,9 +39,9 @@ export default class MessagePadDialogueListContainer extends React.PureComponent
|
||||
<ListItem
|
||||
key={dialogue._id}
|
||||
userName={
|
||||
dialogue.sender_uid === UserContext.uid
|
||||
? dialogue.sendee_udoc.uname
|
||||
: dialogue.sender_udoc.uname
|
||||
dialogue.from === UserContext.uid
|
||||
? dialogue.to_udoc.uname
|
||||
: dialogue.from_udoc.uname
|
||||
}
|
||||
summary={
|
||||
dialogue.isPlaceholder
|
||||
@@ -49,9 +49,9 @@ export default class MessagePadDialogueListContainer extends React.PureComponent
|
||||
: _.last(dialogue.reply).content
|
||||
}
|
||||
faceUrl={
|
||||
dialogue.sender_uid === UserContext.uid
|
||||
? dialogue.sendee_udoc.gravatar_url
|
||||
: dialogue.sender_udoc.gravatar_url
|
||||
dialogue.from === UserContext.uid
|
||||
? dialogue.to_udoc.gravatar_url
|
||||
: dialogue.from_udoc.gravatar_url
|
||||
}
|
||||
active={dialogue._id === this.props.activeId}
|
||||
onClick={() => this.props.handleClick(dialogue._id)}
|
||||
|
||||
@@ -97,7 +97,7 @@ export default class MessagePadInputContainer extends React.PureComponent {
|
||||
if (state.dialogues[this.props.activeId].isPlaceholder) {
|
||||
this.props.postSend(
|
||||
this.props.activeId,
|
||||
state.dialogues[this.props.activeId].sendee_uid,
|
||||
state.dialogues[this.props.activeId].to,
|
||||
this.props.inputValue,
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -7,11 +7,11 @@ export default function reducer(state = {}, action) {
|
||||
return _.keyBy(
|
||||
_.filter(
|
||||
_.map(messages, (m) => ({
|
||||
sendee_udoc: udict[m.sendee_uid],
|
||||
sender_udoc: udict[m.sender_uid],
|
||||
to_udoc: udict[m.to],
|
||||
from_udoc: udict[m.from],
|
||||
...m,
|
||||
})),
|
||||
(m) => m.sendee_udoc && m.sender_udoc,
|
||||
(m) => m.to_udoc && m.from_udoc,
|
||||
),
|
||||
'_id',
|
||||
);
|
||||
@@ -22,9 +22,9 @@ export default function reducer(state = {}, action) {
|
||||
...state,
|
||||
[id]: {
|
||||
_id: id,
|
||||
sender_uid: UserContext.uid,
|
||||
sendee_uid: user._id,
|
||||
sendee_udoc: { ...user },
|
||||
from: UserContext.uid,
|
||||
to: user._id,
|
||||
to_udoc: { ...user },
|
||||
reply: [],
|
||||
isPlaceholder: true,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user