Skip to content

Commit cd4c30c

Browse files
authored
fix: prefer to use url from meta instead of suiteUrl (#588)
1 parent 4584b67 commit cd4c30c

File tree

1 file changed

+5
-3
lines changed
  • lib/static/components/icons/view-in-browser

1 file changed

+5
-3
lines changed

lib/static/components/icons/view-in-browser/index.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import classNames from 'classnames';
66
import {Eye, EyeSlash} from '@gravity-ui/icons';
77

88
import * as actions from '../../../modules/actions';
9-
import {getUrlWithBase} from '../../../../common-utils';
9+
import {getRelativeUrl, getUrlWithBase} from '../../../../common-utils';
1010

1111
import './index.styl';
1212

@@ -41,7 +41,7 @@ class ViewInBrowser extends Component {
4141
return (
4242
<a
4343
className={className}
44-
href={getUrlWithBase(suiteUrl, baseHost)}
44+
href={getUrlWithBase(getRelativeUrl(suiteUrl), baseHost)}
4545
onClick={this.onViewInBrowser}
4646
title="view in browser"
4747
target="_blank"
@@ -53,8 +53,10 @@ class ViewInBrowser extends Component {
5353

5454
export default connect(
5555
({tree, view}, {resultId}) => {
56+
const result = tree.results.byId[resultId];
57+
5658
return {
57-
suiteUrl: tree.results.byId[resultId].suiteUrl,
59+
suiteUrl: result.metaInfo?.url ?? result.suiteUrl,
5860
baseHost: view.baseHost
5961
};
6062
},

0 commit comments

Comments
 (0)