MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / autoOpenUserApiKey

Function autoOpenUserApiKey

frontend/src/components/IframeBox/handler.ts:31–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29) => Promise<any>;
30
31export async function autoOpenUserApiKey() {
32 const { execute } = setUserApiKey();
33 const { state, updateUserInfo } = useAppStateStore();
34 if (state.userInfo?.apiKey) {
35 return {
36 apiKey: state.userInfo?.apiKey
37 };
38 }
39 await execute({
40 data: {
41 enable: true
42 },
43 forceRequest: true,
44 errorAlert: true
45 });
46 await updateUserInfo();
47 return {
48 apiKey: state.userInfo?.apiKey
49 };
50}
51
52export async function getUserInfo() {
53 const { state } = useAppStateStore();

Callers 1

handler.tsFile · 0.85

Calls 2

executeFunction · 0.85
updateUserInfoFunction · 0.85

Tested by

no test coverage detected