f05cfd0cf8
* Refactor: migrate waitingUserPanel to TS and graphql * Small code improvements * Fix: allow everyone aren't working * Fix: add a condition for edge cases * Make the remember choice works well * Fix TS and eslint errors * Change eslint * Change eslint
37 lines
695 B
TypeScript
37 lines
695 B
TypeScript
import { gql } from '@apollo/client';
|
|
import { User } from '/imports/ui/Types/user';
|
|
|
|
export type GuestWaitingUser = {
|
|
isAllowed: boolean
|
|
guestLobbyMessage: string | null;
|
|
isDenied: boolean;
|
|
user: Partial<User>;
|
|
};
|
|
|
|
export interface GuestWaitingUsers {
|
|
user_guest: Array<GuestWaitingUser>
|
|
}
|
|
|
|
export const GET_GUEST_WAITING_USERS_SUBSCRIPTION = gql`
|
|
subscription getGuestWaitingUsers {
|
|
user_guest(where: {isWaiting: {_eq: true}}) {
|
|
guestLobbyMessage
|
|
isAllowed
|
|
isDenied
|
|
userId
|
|
user {
|
|
authed
|
|
userId
|
|
name
|
|
color
|
|
role
|
|
avatar
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export default {
|
|
GET_GUEST_WAITING_USERS_SUBSCRIPTION,
|
|
};
|