Skip to content

Commit f0ebe9c

Browse files
committed
Revert "feat: move to recent on workspace change and reset state data"
This reverts commit 2b373e1.
1 parent 2b373e1 commit f0ebe9c

File tree

2 files changed

+9
-26
lines changed

2 files changed

+9
-26
lines changed

packages/app/src/app/overmind/actions.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -516,13 +516,7 @@ export const setActiveTeam = async (
516516

517517
state.activeTeam = id;
518518
effects.browser.storage.set(TEAM_ID_LOCAL_STORAGE, id);
519-
520-
// Clear sandboxes and repositories
521-
state.dashboard.sandboxes = {
522-
...DEFAULT_DASHBOARD_SANDBOXES,
523-
};
524-
state.dashboard.contributions = null;
525-
state.dashboard.repositories = null;
519+
state.dashboard.sandboxes = DEFAULT_DASHBOARD_SANDBOXES;
526520

527521
actions.internal.replaceWorkspaceParameterInUrl();
528522

packages/app/src/app/pages/Dashboard/Sidebar/index.tsx

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,14 @@ export const Sidebar: React.FC<SidebarProps> = ({
4848
onSidebarToggle,
4949
...props
5050
}) => {
51-
const history = useHistory();
5251
const state = useAppState();
5352
const actions = useActions();
5453
const [activeAccount, setActiveAccount] = useState<{
5554
id: string;
5655
name: string;
5756
avatarUrl: string;
5857
} | null>(null);
59-
const {
60-
dashboard,
61-
activeTeam,
62-
activeTeamInfo,
63-
user,
64-
personalWorkspaceId,
65-
} = state;
58+
const { dashboard, activeTeam, activeTeamInfo, user } = state;
6659

6760
React.useEffect(() => {
6861
actions.dashboard.getAllFolders();
@@ -72,7 +65,7 @@ export const Sidebar: React.FC<SidebarProps> = ({
7265
if (state.activeTeam) {
7366
const team = dashboard.teams.find(({ id }) => id === state.activeTeam);
7467
if (team) {
75-
const isPersonalWorkspace = team.id === personalWorkspaceId;
68+
const isPersonalWorkspace = team.id === state.personalWorkspaceId;
7669
setActiveAccount({
7770
id: team.id,
7871
name: team.name,
@@ -159,8 +152,6 @@ export const Sidebar: React.FC<SidebarProps> = ({
159152
actions.setActiveTeam({
160153
id: workspace.id,
161154
});
162-
163-
history.replace(dashboardUrls.recent(workspace.id));
164155
}}
165156
activeAccount={activeAccount}
166157
/>
@@ -208,14 +199,12 @@ export const Sidebar: React.FC<SidebarProps> = ({
208199
Repositories
209200
</Text>
210201
</Element>
211-
{activeTeam === personalWorkspaceId && (
212-
<RowItem
213-
name="My contributions"
214-
page="my-contributions"
215-
path={dashboardUrls.myContributions(activeTeam)}
216-
icon="contribution"
217-
/>
218-
)}
202+
<RowItem
203+
name="My contributions"
204+
page="my-contributions"
205+
path={dashboardUrls.myContributions(activeTeam)}
206+
icon="contribution"
207+
/>
219208
<RowItem
220209
name="All repositories"
221210
page="repositories"

0 commit comments

Comments
 (0)