0.3.5 共享功能修复
This commit is contained in:
@@ -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 };
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user