MCPcopy Create free account
hub / github.com/experdot/pointer / removeAccount

Function removeAccount

src/renderer/src/services/accountService.ts:100–115  ·  view source on GitHub ↗
(accountId: string)

Source from the content-addressed store, hash-verified

98
99// 删除账户
100export async function removeAccount(accountId: string): Promise<void> {
101 const { account } = stores
102
103 // 不能删除默认账户
104 if (accountId === getDefaultAccountId()) {
105 throw new Error('Cannot delete default account')
106 }
107
108 // 不能删除当前账户
109 if (accountId === account.currentAccountId) {
110 throw new Error('Cannot delete current account')
111 }
112
113 // 先从列表中移除,再删除数据
114 await account.delete(accountId)
115}
116
117// 获取当前账户
118export function getCurrentAccount(): Account | null {

Callers

nothing calls this directly

Calls 2

getDefaultAccountIdFunction · 0.90
deleteMethod · 0.65

Tested by

no test coverage detected