MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / setOwnerAndApplyProfile

Function setOwnerAndApplyProfile

src/stores/session.ts:695–704  ·  view source on GitHub ↗

* 手动选择"我是谁":写入当前会话 owner,更新平台 owner profile, * 并批量应用到同平台其他未设置 owner 的会话

(id: string, ownerPlatformId: string)

Source from the content-addressed store, hash-verified

693 * 并批量应用到同平台其他未设置 owner 的会话
694 */
695 async function setOwnerAndApplyProfile(id: string, ownerPlatformId: string) {
696 const result = await useDataService().setOwnerAndApplyProfile(id, ownerPlatformId)
697 for (const sessionId of [id, ...result.updatedSessionIds]) {
698 const session = sessions.value.find((s) => s.id === sessionId)
699 if (session) {
700 session.ownerId = result.updatedSessionOwnerIds[sessionId] ?? result.ownerId
701 }
702 }
703 return result
704 }
705
706 /**
707 * 尝试用已保存的平台 owner profile 自动补全会话 owner(唯一匹配才写入)

Callers

nothing calls this directly

Calls 2

useDataServiceFunction · 0.90

Tested by

no test coverage detected