* 重命名会话
(id: string, newName: string)
| 647 | * 重命名会话 |
| 648 | */ |
| 649 | async function renameSession(id: string, newName: string): Promise<boolean> { |
| 650 | try { |
| 651 | const success = await useDataService().renameSession(id, newName) |
| 652 | if (success) { |
| 653 | const session = sessions.value.find((s) => s.id === id) |
| 654 | if (session) { |
| 655 | session.name = newName |
| 656 | } |
| 657 | } |
| 658 | return success |
| 659 | } catch (error) { |
| 660 | console.error('重命名会话失败:', error) |
| 661 | return false |
| 662 | } |
| 663 | } |
| 664 | |
| 665 | /** |
| 666 | * 清空当前选中会话 |
nothing calls this directly
no test coverage detected