diff --git a/packages/app/features/top/ChannelScreen.tsx b/packages/app/features/top/ChannelScreen.tsx index 1cd05348f6..f954a539d3 100644 --- a/packages/app/features/top/ChannelScreen.tsx +++ b/packages/app/features/top/ChannelScreen.tsx @@ -74,9 +74,9 @@ export default function ChannelScreen(props: Props) { if (group) { // Update the last visited channel in the group so we can return to it // when we come back to the group - db.updateLastVisitedChannelInGroup({ - groupId: group.id, - channelId: channel.id, + db.updateGroup({ + id: group.id, + lastVisitedChannelId: channel.id, }); } } diff --git a/packages/shared/src/db/queries.ts b/packages/shared/src/db/queries.ts index e71dc245a3..4a7f93516a 100644 --- a/packages/shared/src/db/queries.ts +++ b/packages/shared/src/db/queries.ts @@ -646,20 +646,6 @@ export const deleteGroup = createWriteQuery( ['groups', 'channels'] ); -export const updateLastVisitedChannelInGroup = createWriteQuery( - 'updateLastVisitedChannelInGroup', - async ( - { groupId, channelId }: { groupId: string; channelId: string }, - ctx: QueryCtx - ) => { - return ctx.db - .update($groups) - .set({ lastVisitedChannelId: channelId }) - .where(eq($groups.id, groupId)); - }, - ['groups'] -); - export const insertUnjoinedGroups = createWriteQuery( 'insertUnjoinedGroups', async (groups: Group[], ctx: QueryCtx) => {