@@ -48,14 +48,21 @@ export const Sidebar: React.FC<SidebarProps> = ({
48
48
onSidebarToggle,
49
49
...props
50
50
} ) => {
51
+ const history = useHistory ( ) ;
51
52
const state = useAppState ( ) ;
52
53
const actions = useActions ( ) ;
53
54
const [ activeAccount , setActiveAccount ] = useState < {
54
55
id : string ;
55
56
name : string ;
56
57
avatarUrl : string ;
57
58
} | null > ( null ) ;
58
- const { dashboard, activeTeam, activeTeamInfo, user } = state ;
59
+ const {
60
+ dashboard,
61
+ activeTeam,
62
+ activeTeamInfo,
63
+ user,
64
+ personalWorkspaceId,
65
+ } = state ;
59
66
60
67
React . useEffect ( ( ) => {
61
68
actions . dashboard . getAllFolders ( ) ;
@@ -65,7 +72,7 @@ export const Sidebar: React.FC<SidebarProps> = ({
65
72
if ( state . activeTeam ) {
66
73
const team = dashboard . teams . find ( ( { id } ) => id === state . activeTeam ) ;
67
74
if ( team ) {
68
- const isPersonalWorkspace = team . id === state . personalWorkspaceId ;
75
+ const isPersonalWorkspace = team . id === personalWorkspaceId ;
69
76
setActiveAccount ( {
70
77
id : team . id ,
71
78
name : team . name ,
@@ -152,6 +159,8 @@ export const Sidebar: React.FC<SidebarProps> = ({
152
159
actions . setActiveTeam ( {
153
160
id : workspace . id ,
154
161
} ) ;
162
+
163
+ history . replace ( dashboardUrls . recent ( workspace . id ) ) ;
155
164
} }
156
165
activeAccount = { activeAccount }
157
166
/>
@@ -199,12 +208,14 @@ export const Sidebar: React.FC<SidebarProps> = ({
199
208
Repositories
200
209
</ Text >
201
210
</ Element >
202
- < RowItem
203
- name = "My contributions"
204
- page = "my-contributions"
205
- path = { dashboardUrls . myContributions ( activeTeam ) }
206
- icon = "contribution"
207
- />
211
+ { activeTeam === personalWorkspaceId && (
212
+ < RowItem
213
+ name = "My contributions"
214
+ page = "my-contributions"
215
+ path = { dashboardUrls . myContributions ( activeTeam ) }
216
+ icon = "contribution"
217
+ />
218
+ ) }
208
219
< RowItem
209
220
name = "All repositories"
210
221
page = "repositories"
0 commit comments