Skip to content

Commit

Permalink
♻️ Use proper way to get abs url
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Apr 21, 2023
1 parent b97b18e commit 00fdd0b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions x-pack/plugins/lens/public/app_plugin/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,17 +457,14 @@ export function App({
}
if (locator && shortUrls) {
// This is a stripped down version of what the share URL plugin is doing
const relativeUrl = await shortUrls.create({ locator, params });
const absoluteShortUrl = application.getUrlForApp('', {
path: `/r/s/${relativeUrl.data.slug}`,
absolute: true,
});
const shortUrl = await shortUrls.createWithLocator({ locator, params });
const absoluteShortUrl = await shortUrl.locator.getUrl(shortUrl.params, { absolute: true });
shareURLCache.current = { params: cacheKey, url: absoluteShortUrl };
return absoluteShortUrl;
}
return '';
},
[locator, application, shortUrls]
[locator, shortUrls]
);

const returnToOriginSwitchLabelForContext =
Expand Down

0 comments on commit 00fdd0b

Please sign in to comment.