mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge branch 'master' into 6557-chat-reactive-language-switch
This commit is contained in:
commit
cfc34495a7
@ -11,6 +11,8 @@ import {
|
||||
changeGroupMemberRoleMutation,
|
||||
} from '../graphql/groups'
|
||||
import { createPostMutation } from '../graphql/posts'
|
||||
import { createRoomMutation } from '../graphql/rooms'
|
||||
import { createMessageMutation } from '../graphql/messages'
|
||||
import { createCommentMutation } from '../graphql/comments'
|
||||
import { categories } from '../constants/categories'
|
||||
|
||||
@ -1553,6 +1555,90 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
|
||||
)
|
||||
|
||||
await Factory.build('donations')
|
||||
|
||||
// Chat
|
||||
authenticatedUser = await huey.toJson()
|
||||
const { data: roomHueyPeter } = await mutate({
|
||||
mutation: createRoomMutation(),
|
||||
variables: {
|
||||
userId: (await peterLustig.toJson()).id,
|
||||
},
|
||||
})
|
||||
|
||||
for (let i = 0; i < 30; i++) {
|
||||
authenticatedUser = await huey.toJson()
|
||||
await mutate({
|
||||
mutation: createMessageMutation(),
|
||||
variables: {
|
||||
roomId: roomHueyPeter?.CreateRoom.id,
|
||||
content: faker.lorem.sentence(),
|
||||
},
|
||||
})
|
||||
authenticatedUser = await peterLustig.toJson()
|
||||
await mutate({
|
||||
mutation: createMessageMutation(),
|
||||
variables: {
|
||||
roomId: roomHueyPeter?.CreateRoom.id,
|
||||
content: faker.lorem.sentence(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
authenticatedUser = await huey.toJson()
|
||||
const { data: roomHueyJenny } = await mutate({
|
||||
mutation: createRoomMutation(),
|
||||
variables: {
|
||||
userId: (await jennyRostock.toJson()).id,
|
||||
},
|
||||
})
|
||||
for (let i = 0; i < 1000; i++) {
|
||||
authenticatedUser = await huey.toJson()
|
||||
await mutate({
|
||||
mutation: createMessageMutation(),
|
||||
variables: {
|
||||
roomId: roomHueyJenny?.CreateRoom.id,
|
||||
content: faker.lorem.sentence(),
|
||||
},
|
||||
})
|
||||
authenticatedUser = await jennyRostock.toJson()
|
||||
await mutate({
|
||||
mutation: createMessageMutation(),
|
||||
variables: {
|
||||
roomId: roomHueyJenny?.CreateRoom.id,
|
||||
content: faker.lorem.sentence(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
for (const user of additionalUsers) {
|
||||
authenticatedUser = await jennyRostock.toJson()
|
||||
const { data: room } = await mutate({
|
||||
mutation: createRoomMutation(),
|
||||
variables: {
|
||||
userId: (await user.toJson()).id,
|
||||
},
|
||||
})
|
||||
|
||||
for (let i = 0; i < 29; i++) {
|
||||
authenticatedUser = await jennyRostock.toJson()
|
||||
await mutate({
|
||||
mutation: createMessageMutation(),
|
||||
variables: {
|
||||
roomId: room?.CreateRoom.id,
|
||||
content: faker.lorem.sentence(),
|
||||
},
|
||||
})
|
||||
authenticatedUser = await user.toJson()
|
||||
await mutate({
|
||||
mutation: createMessageMutation(),
|
||||
variables: {
|
||||
roomId: room?.CreateRoom.id,
|
||||
content: faker.lorem.sentence(),
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-disable-next-line no-console */
|
||||
console.log('Seeded Data...')
|
||||
await driver.close()
|
||||
|
||||
@ -190,10 +190,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async fetchMessages({ room, options = {} }) {
|
||||
if (this.selectedRoom !== room.id) {
|
||||
if (this.selectedRoom?.id !== room.id) {
|
||||
this.messages = []
|
||||
this.messagePage = 0
|
||||
this.selectedRoom = room.id
|
||||
this.selectedRoom = room
|
||||
}
|
||||
this.messagesLoaded = options.refetch ? this.messagesLoaded : false
|
||||
const offset = (options.refetch ? 0 : this.messagePage) * this.messagePageSize
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user