@@ -99,9 +99,7 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
|
||||
|
||||
@Component({
|
||||
apollo: {
|
||||
currentActor: {
|
||||
query: CURRENT_ACTOR_CLIENT,
|
||||
},
|
||||
currentActor: CURRENT_ACTOR_CLIENT,
|
||||
comments: {
|
||||
query: COMMENTS_THREADS_WITH_REPLIES,
|
||||
variables() {
|
||||
@@ -152,7 +150,6 @@ export default class CommentTree extends Vue {
|
||||
}
|
||||
|
||||
async createCommentForEvent(comment: IComment): Promise<void> {
|
||||
console.log("creating comment", comment);
|
||||
this.emptyCommentError = ["", "<p></p>"].includes(comment.text);
|
||||
if (this.emptyCommentError) return;
|
||||
try {
|
||||
|
||||
@@ -217,25 +217,24 @@ export default class ParticipationWithoutAccount extends Vue {
|
||||
);
|
||||
return;
|
||||
}
|
||||
const { event } = cachedData;
|
||||
if (event === null) {
|
||||
console.error(
|
||||
"Cannot update event participant cache, because of null value."
|
||||
);
|
||||
return;
|
||||
}
|
||||
const participantStats = { ...cachedData.event.participantStats };
|
||||
|
||||
if (updateData.joinEvent.role === ParticipantRole.NOT_CONFIRMED) {
|
||||
event.participantStats.notConfirmed += 1;
|
||||
participantStats.notConfirmed += 1;
|
||||
} else {
|
||||
event.participantStats.going += 1;
|
||||
event.participantStats.participant += 1;
|
||||
participantStats.going += 1;
|
||||
participantStats.participant += 1;
|
||||
}
|
||||
|
||||
store.writeQuery({
|
||||
query: FETCH_EVENT_BASIC,
|
||||
variables: { uuid: this.event.uuid },
|
||||
data: { event },
|
||||
data: {
|
||||
event: {
|
||||
...cachedData.event,
|
||||
participantStats,
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user