Merge branch 'master' of github.com:Ocelot-Social-Community/Ocelot-Social into fix-code-in-editor-component

This commit is contained in:
Wolfgang Huß 2023-07-21 07:27:19 +02:00
commit d57e3aa0f3
17 changed files with 24 additions and 32 deletions

View File

@ -25,8 +25,8 @@ export default {
chatMessageAdded: {
subscribe: withFilter(
() => pubsub.asyncIterator(CHAT_MESSAGE_ADDED),
(payload, variables) => {
return payload.userId === variables.userId
(payload, variables, context) => {
return payload.userId === context.user?.id
},
),
},

View File

@ -7,8 +7,8 @@ export default {
notificationAdded: {
subscribe: withFilter(
() => pubsub.asyncIterator(NOTIFICATION_ADDED),
(payload, variables) => {
return payload.notificationAdded.to.id === variables.userId
(payload, variables, context) => {
return payload.notificationAdded.to.id === context.user?.id
},
),
},

View File

@ -20,8 +20,8 @@ export default {
roomCountUpdated: {
subscribe: withFilter(
() => pubsub.asyncIterator(ROOM_COUNT_UPDATED),
(payload, variables) => {
return payload.userId === variables.userId
(payload, variables, context) => {
return payload.userId === context.user?.id
},
),
},

View File

@ -46,5 +46,5 @@ type Query {
}
type Subscription {
chatMessageAdded(userId: ID!): Message
chatMessageAdded: Message
}

View File

@ -38,5 +38,5 @@ type Mutation {
}
type Subscription {
notificationAdded(userId: ID!): NOTIFIED
notificationAdded: NOTIFIED
}

View File

@ -58,5 +58,5 @@ type Query {
}
type Subscription {
roomCountUpdated(userId: ID!): Int
roomCountUpdated: Int
}

View File

@ -31,4 +31,7 @@
chatMessageTimestamp: $chat-message-timestamp;
chatMessageCheckmarkSeen: $chat-message-checkmark-seen;
chatMessageCheckmark: $chat-message-checkmark;
chatRoomBackgroundCounterBadge: $chat-room-background-counter-badge;
chatRoomColorCounterBadge: $chat-room-color-counter-badge;
}

View File

@ -420,3 +420,5 @@ $chat-new-message-color: $color-secondary-active;
$chat-message-timestamp: $text-color-soft;
$chat-message-checkmark-seen: $text-color-secondary;
$chat-message-checkmark: $text-color-soft;
$chat-room-color-counter-badge: $text-color-inverse;
$chat-room-background-counter-badge: $color-secondary;

View File

@ -181,9 +181,6 @@ export default {
// Subscriptions
const observer = this.$apollo.subscribe({
query: chatMessageAdded(),
variables: {
userId: this.currentUser.id,
},
})
observer.subscribe({

View File

@ -44,11 +44,6 @@ export default {
},
subscribeToMore: {
document: roomCountUpdated(),
variables() {
return {
userId: this.user.id,
}
},
updateQuery: (previousResult, { subscriptionData }) => {
return { UnreadRooms: subscriptionData.data.roomCountUpdated }
},

View File

@ -137,11 +137,6 @@ export default {
},
subscribeToMore: {
document: notificationAdded(),
variables() {
return {
userId: this.user.id,
}
},
updateQuery: (previousResult, { subscriptionData }) => {
const {
data: { notificationAdded: newNotification },

View File

@ -109,8 +109,8 @@ const STYLE = {
colorTimestamp: '#a2aeb8',
colorStateOnline: '#4caf50',
colorStateOffline: '#9ca6af',
backgroundCounterBadge: '#0696c7',
colorCounterBadge: '#fff',
backgroundCounterBadge: styleData.chatRoomBackgroundCounterBadge,
colorCounterBadge: styleData.chatRoomColorCounterBadge,
},
emoji: {

View File

@ -54,8 +54,8 @@ export const messageQuery = () => {
export const chatMessageAdded = () => {
return gql`
subscription chatMessageAdded($userId: ID!) {
chatMessageAdded(userId: $userId) {
subscription chatMessageAdded {
chatMessageAdded {
_id
id
indexId

View File

@ -66,8 +66,8 @@ export const unreadRoomsQuery = () => {
export const roomCountUpdated = () => {
return gql`
subscription roomCountUpdated($userId: ID!) {
roomCountUpdated(userId: $userId)
subscription roomCountUpdated {
roomCountUpdated
}
`
}

View File

@ -245,8 +245,8 @@ export const notificationAdded = () => {
${postFragment}
${groupFragment}
subscription notifications($userId: ID!) {
notificationAdded(userId: $userId) {
subscription notifications {
notificationAdded {
id
read
reason

View File

@ -902,7 +902,7 @@
"Tag": "Hashtag ::: Hashtags",
"User": "Nutzer ::: Nutzer"
},
"hint": "Wonach suchst Du? Nutze !… für Beiträge, @… für Mitglieder, &… für Gruppen, #… für Hashtags",
"hint": "!... sucht Beiträge, @... sucht Nutzer, &... sucht Gruppen, #… sucht Hashtags",
"no-results": "Keine Ergebnisse für \"{search}\" gefunden. Versuch' es mit einem anderen Begriff!",
"page": "Seite",
"placeholder": "Suchen",

View File

@ -902,7 +902,7 @@
"Tag": "Hashtag ::: Hashtags",
"User": "User ::: Users"
},
"hint": "What are you searching for? Use !… for posts, @… for users, &… for groups, #… for hashtags.",
"hint": "!... searches posts, @... searches users, &... searches groups, #… searches hashtags",
"no-results": "No results found for \"{search}\". Try a different search term!",
"page": "Page",
"placeholder": "Search",