MCPcopy
hub / github.com/wavetermdev/waveterm / loadBadges

Function loadBadges

frontend/app/store/badge.ts:147–160  ·  view source on GitHub ↗
(env?: LoadBadgesEnv)

Source from the content-addressed store, hash-verified

145}
146
147async function loadBadges(env?: LoadBadgesEnv) {
148 const rpc = env != null ? env.rpc : RpcApi;
149 const badges = await rpc.GetAllBadgesCommand(TabRpcClient);
150 if (badges == null) {
151 return;
152 }
153 for (const badgeEvent of badges) {
154 if (badgeEvent.oref == null) {
155 continue;
156 }
157 const curAtom = getBadgeAtom(badgeEvent.oref);
158 globalStore.set(curAtom, badgeEvent.badge ?? null);
159 }
160}
161
162function setBadge(blockId: string, badge: Omit<Badge, "badgeid"> & { badgeid?: string }, env?: BadgeEnv) {
163 if (!badge.badgeid) {

Callers 3

initWaveFunction · 0.90
TabBarPreviewInnerFunction · 0.90
VTabBarPreviewInnerFunction · 0.90

Calls 3

getBadgeAtomFunction · 0.85
setMethod · 0.80
GetAllBadgesCommandMethod · 0.65

Tested by

no test coverage detected