0.3.5 共享功能修复

This commit is contained in:
liaibo
2026-01-24 12:32:51 +08:00
parent 25923f308c
commit 3c3f407f4b
44 changed files with 3754 additions and 420 deletions
+5 -2
View File
@@ -103,7 +103,11 @@ async function resolveGroupSharePermission(ctx: any, doc: any, userId: string):
export const isStarred = query({
args: { documentId: v.string() },
handler: async (ctx, args) => {
const userId = await requireUserId(ctx);
// 退出登录/未登录时,客户端仍可能会发起 isStarred 查询(例如 Breadcrumb 仍在渲染)。
// 这里不要抛错,直接返回 false,避免把“未登录”作为运行时错误冒泡到前端。
const authUserId = await getAuthUserId(ctx);
if (authUserId === null) return false;
const userId = String(authUserId);
const doc = await ctx.db
.query("documents")
@@ -182,4 +186,3 @@ export const toggle = mutation({
return { ok: true, starred: true };
},
});