fix: no pending for rejects
This commit is contained in:
parent
4a802571f6
commit
a5d2476cdb
|
@ -29,7 +29,6 @@ export default function ChatSubmitMessage() {
|
||||||
channel,
|
channel,
|
||||||
message: chunk,
|
message: chunk,
|
||||||
owner: '/r/anonymous' === channel ? 0 : user.id,
|
owner: '/r/anonymous' === channel ? 0 : user.id,
|
||||||
pending: true,
|
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
uuid: uuidv4(),
|
uuid: uuidv4(),
|
||||||
}));
|
}));
|
||||||
|
|
2
src/client/store/effects.js
vendored
2
src/client/store/effects.js
vendored
|
@ -108,7 +108,7 @@ const effects = {
|
||||||
socket.send(new Leave(payload), () => dispatch(leave({channel})));
|
socket.send(new Leave(payload), () => dispatch(leave({channel})));
|
||||||
},
|
},
|
||||||
[submitMessage]: async ({dispatch}, {payload}) => {
|
[submitMessage]: async ({dispatch}, {payload}) => {
|
||||||
dispatch(addMessage(payload));
|
dispatch(addMessage({...payload, pending: true}));
|
||||||
const reject = (ttr) => {
|
const reject = (ttr) => {
|
||||||
dispatch(rejectMessage(payload.uuid));
|
dispatch(rejectMessage(payload.uuid));
|
||||||
dispatch(addMessage({
|
dispatch(addMessage({
|
||||||
|
|
|
@ -76,6 +76,7 @@ const slice = createSlice({
|
||||||
users.splice(users.indexOf(id), 1);
|
users.splice(users.indexOf(id), 1);
|
||||||
},
|
},
|
||||||
rejectMessage: ({messages}, {payload: uuid}) => {
|
rejectMessage: ({messages}, {payload: uuid}) => {
|
||||||
|
delete messages[uuid].pending;
|
||||||
messages[uuid].rejected = true;
|
messages[uuid].rejected = true;
|
||||||
},
|
},
|
||||||
removeMessage: (state, {payload: {channel, uuid}}) => {
|
removeMessage: (state, {payload: {channel, uuid}}) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user