diff --git a/backend/src/schema/resolvers/messages.ts b/backend/src/schema/resolvers/messages.ts index b7e7a7a73..c1381045f 100644 --- a/backend/src/schema/resolvers/messages.ts +++ b/backend/src/schema/resolvers/messages.ts @@ -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 }, ), }, diff --git a/backend/src/schema/resolvers/notifications.ts b/backend/src/schema/resolvers/notifications.ts index e427de227..6a3e232cc 100644 --- a/backend/src/schema/resolvers/notifications.ts +++ b/backend/src/schema/resolvers/notifications.ts @@ -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 }, ), }, diff --git a/backend/src/schema/resolvers/rooms.ts b/backend/src/schema/resolvers/rooms.ts index 5e931a446..5382c5ee7 100644 --- a/backend/src/schema/resolvers/rooms.ts +++ b/backend/src/schema/resolvers/rooms.ts @@ -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 }, ), }, diff --git a/backend/src/schema/types/type/Message.gql b/backend/src/schema/types/type/Message.gql index 71d175e1c..16e458151 100644 --- a/backend/src/schema/types/type/Message.gql +++ b/backend/src/schema/types/type/Message.gql @@ -46,5 +46,5 @@ type Query { } type Subscription { - chatMessageAdded(userId: ID!): Message + chatMessageAdded: Message } diff --git a/backend/src/schema/types/type/NOTIFIED.gql b/backend/src/schema/types/type/NOTIFIED.gql index 62a1f3696..1f825decc 100644 --- a/backend/src/schema/types/type/NOTIFIED.gql +++ b/backend/src/schema/types/type/NOTIFIED.gql @@ -38,5 +38,5 @@ type Mutation { } type Subscription { - notificationAdded(userId: ID!): NOTIFIED + notificationAdded: NOTIFIED } diff --git a/backend/src/schema/types/type/Room.gql b/backend/src/schema/types/type/Room.gql index d758808bb..60d54192c 100644 --- a/backend/src/schema/types/type/Room.gql +++ b/backend/src/schema/types/type/Room.gql @@ -58,5 +58,5 @@ type Query { } type Subscription { - roomCountUpdated(userId: ID!): Int + roomCountUpdated: Int } diff --git a/webapp/assets/_new/styles/export.scss b/webapp/assets/_new/styles/export.scss index 5b866d6b7..e29c014e2 100644 --- a/webapp/assets/_new/styles/export.scss +++ b/webapp/assets/_new/styles/export.scss @@ -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; } \ No newline at end of file diff --git a/webapp/assets/_new/styles/tokens.scss b/webapp/assets/_new/styles/tokens.scss index ef5086240..dd3a042d1 100644 --- a/webapp/assets/_new/styles/tokens.scss +++ b/webapp/assets/_new/styles/tokens.scss @@ -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; diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index c18c12a58..883067666 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -181,9 +181,6 @@ export default { // Subscriptions const observer = this.$apollo.subscribe({ query: chatMessageAdded(), - variables: { - userId: this.currentUser.id, - }, }) observer.subscribe({ diff --git a/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue b/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue index ec3f9fbc7..dd36b965a 100644 --- a/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue +++ b/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue @@ -44,11 +44,6 @@ export default { }, subscribeToMore: { document: roomCountUpdated(), - variables() { - return { - userId: this.user.id, - } - }, updateQuery: (previousResult, { subscriptionData }) => { return { UnreadRooms: subscriptionData.data.roomCountUpdated } }, diff --git a/webapp/components/NotificationMenu/NotificationMenu.vue b/webapp/components/NotificationMenu/NotificationMenu.vue index 9e94e07d7..d0e21bf96 100644 --- a/webapp/components/NotificationMenu/NotificationMenu.vue +++ b/webapp/components/NotificationMenu/NotificationMenu.vue @@ -137,11 +137,6 @@ export default { }, subscribeToMore: { document: notificationAdded(), - variables() { - return { - userId: this.user.id, - } - }, updateQuery: (previousResult, { subscriptionData }) => { const { data: { notificationAdded: newNotification }, diff --git a/webapp/constants/chat.js b/webapp/constants/chat.js index 181d88e0e..de391707d 100644 --- a/webapp/constants/chat.js +++ b/webapp/constants/chat.js @@ -109,8 +109,8 @@ const STYLE = { colorTimestamp: '#a2aeb8', colorStateOnline: '#4caf50', colorStateOffline: '#9ca6af', - backgroundCounterBadge: '#0696c7', - colorCounterBadge: '#fff', + backgroundCounterBadge: styleData.chatRoomBackgroundCounterBadge, + colorCounterBadge: styleData.chatRoomColorCounterBadge, }, emoji: { diff --git a/webapp/graphql/Messages.js b/webapp/graphql/Messages.js index cb5d37df9..ffa2760f9 100644 --- a/webapp/graphql/Messages.js +++ b/webapp/graphql/Messages.js @@ -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 diff --git a/webapp/graphql/Rooms.js b/webapp/graphql/Rooms.js index 46f089e36..221f21c86 100644 --- a/webapp/graphql/Rooms.js +++ b/webapp/graphql/Rooms.js @@ -66,8 +66,8 @@ export const unreadRoomsQuery = () => { export const roomCountUpdated = () => { return gql` - subscription roomCountUpdated($userId: ID!) { - roomCountUpdated(userId: $userId) + subscription roomCountUpdated { + roomCountUpdated } ` } diff --git a/webapp/graphql/User.js b/webapp/graphql/User.js index fcdac0989..4b743a0e3 100644 --- a/webapp/graphql/User.js +++ b/webapp/graphql/User.js @@ -245,8 +245,8 @@ export const notificationAdded = () => { ${postFragment} ${groupFragment} - subscription notifications($userId: ID!) { - notificationAdded(userId: $userId) { + subscription notifications { + notificationAdded { id read reason diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 372703214..a79f5ad1a 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -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", diff --git a/webapp/locales/en.json b/webapp/locales/en.json index e5bdee4fc..4ef7ecd3e 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -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",