Skip to content

Commit

Permalink
fix(umi-ui): set active project when open full umi ui (#3385)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc authored Oct 10, 2019
1 parent 09a7e68 commit 094ff4c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/umi-ui/client/src/layouts/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ export default withRouter(props => {
</Menu>
);

const openFullUmiUI = async url => {
await setCurrentProject({
key: currentProject.key,
});
window.open(url);
};

return (
<div className={styles.normal}>
{isMini && (
Expand All @@ -187,9 +194,12 @@ export default withRouter(props => {
</Col>
<Col className={styles.gotoUi}>
<a
target="_blank"
rel="noopener noreferrer"
href={`${window.location.origin}${window.location.pathname}`}
onClick={openFullUmiUI.bind(
null,
`${window.location.origin}${window.location.pathname}`,
)}
href="javascript:;"
>
<Redirect />
<FormattedMessage id="org.umi.ui.global.dashboard.mini.full" />
Expand Down

0 comments on commit 094ff4c

Please sign in to comment.