MCPcopy Create free account
hub / github.com/bytebase/bytebase / adjustActivatedUserCount

Function adjustActivatedUserCount

frontend/src/react/stores/app/user.ts:50–65  ·  view source on GitHub ↗
(delta: number)

Source from the content-addressed store, hash-verified

48
49export const createUserSlice: AppSliceCreator<UserSlice> = (set, get) => {
50 const adjustActivatedUserCount = (delta: number) => {
51 set((state) => {
52 if (!state.serverInfo) {
53 return {};
54 }
55 return {
56 serverInfo: {
57 ...state.serverInfo,
58 activatedUserCount: Math.max(
59 0,
60 state.serverInfo.activatedUserCount + delta
61 ),
62 },
63 };
64 });
65 };
66
67 return {
68 usersByName: { [allUsersUser().name]: allUsersUser() },

Callers 1

createUserSliceFunction · 0.85

Calls 1

setFunction · 0.85

Tested by

no test coverage detected