Skip to content

Commit 822286b

Browse files
committed
fix: update the community color state
1 parent 0d6c166 commit 822286b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/store/feature/profile/communities.slice.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Submission } from "@/types/bounty";
22
import { Community } from "@/types/community";
33
import { Feedback } from "@/types/feedback";
44
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
5-
import { setColors } from "../ui.slice";
5+
66
import { HYDRATE } from "next-redux-wrapper";
77

88
interface InitialState {
@@ -34,7 +34,6 @@ const communitiesProfile = createSlice({
3434
initialState,
3535
reducers: {
3636
setCurrentProfileCommunity(state, action: PayloadAction<Community>) {
37-
setColors(action.payload.colors);
3837
state.current = action.payload;
3938
},
4039
setListProfileCommunities(state, action: PayloadAction<Community[]>) {

src/store/services/profile/profileCommunities.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
setProfileCommunityReputation,
1010
setProfileCommunitySubmissions,
1111
} from "@/store/feature/profile/communities.slice";
12+
import { setColors } from "@/store/feature/ui.slice";
13+
1214
import { Reputation, Submission } from "@/types/bounty";
1315
import { Community } from "@/types/community";
1416
import { Feedback } from "@/types/feedback";
@@ -72,6 +74,7 @@ const profileCommunitiesService: any = createApi({
7274
dispatch(setProfileCommunityFeedbacks(data.feedbacks));
7375
dispatch(setProfileCommunitySubmissions(data.submissions));
7476
dispatch(setProfileCommunityReputation(data.reputation));
77+
dispatch(setColors(data.community.colors));
7578
} catch (error) {
7679
dispatch(setBusy(false));
7780
dispatch(setError(error));

0 commit comments

Comments
 (0)