This commit is contained in:
@@ -61,6 +61,7 @@ export const updateState = mutation({
|
||||
isMuted: v.optional(v.boolean()),
|
||||
isDeafened: v.optional(v.boolean()),
|
||||
isScreenSharing: v.optional(v.boolean()),
|
||||
isCameraOn: v.optional(v.boolean()),
|
||||
},
|
||||
returns: v.null(),
|
||||
handler: async (ctx, args) => {
|
||||
@@ -155,6 +156,7 @@ export const getAll = query({
|
||||
isMuted: boolean;
|
||||
isDeafened: boolean;
|
||||
isScreenSharing: boolean;
|
||||
isCameraOn: boolean;
|
||||
isServerMuted: boolean;
|
||||
avatarUrl: string | null;
|
||||
joinSoundUrl: string | null;
|
||||
@@ -186,6 +188,7 @@ export const getAll = query({
|
||||
isMuted: s.isMuted,
|
||||
isDeafened: s.isDeafened,
|
||||
isScreenSharing: s.isScreenSharing,
|
||||
isCameraOn: s.isCameraOn ?? false,
|
||||
isServerMuted: s.isServerMuted,
|
||||
avatarUrl,
|
||||
joinSoundUrl,
|
||||
@@ -357,7 +360,7 @@ export const moveUser = mutation({
|
||||
// No-op if already in the target channel
|
||||
if (currentState.channelId === args.targetChannelId) return null;
|
||||
|
||||
// Delete old voice state and insert new one preserving mute/deaf/screenshare
|
||||
// Delete old voice state and insert new one preserving mute/deaf/screenshare/camera
|
||||
await ctx.db.delete(currentState._id);
|
||||
await ctx.db.insert("voiceStates", {
|
||||
channelId: args.targetChannelId,
|
||||
@@ -366,6 +369,7 @@ export const moveUser = mutation({
|
||||
isMuted: currentState.isMuted,
|
||||
isDeafened: currentState.isDeafened,
|
||||
isScreenSharing: currentState.isScreenSharing,
|
||||
isCameraOn: currentState.isCameraOn ?? false,
|
||||
isServerMuted: currentState.isServerMuted,
|
||||
lastHeartbeat: Date.now(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user