Skip to content

Commit

Permalink
Add return label to studio link
Browse files Browse the repository at this point in the history
  • Loading branch information
owi92 committed Sep 6, 2023
1 parent e522d9f commit a20ddcc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion frontend/src/layout/header/UserBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ const LoggedIn: React.FC<LoggedInProps> = ({ user }) => {
icon: <FiVideo />,
wrapper: <ExternalLink
service="STUDIO"
params={{ "return.target": new URL(document.location.href) }}
params={{
"return.target": new URL(document.location.href),
"return.label": "Tobira",
}}
fallback="link"
/>,
keepOpenAfterClick: true,
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/relay/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type ExternalLinkProps = PropsWithChildren<{
service: "STUDIO";
params: {
"return.target": URL;
"return.label": string;
};
} | {
service: "EDITOR";
Expand All @@ -49,7 +50,7 @@ export const ExternalLink: React.FC<ExternalLinkProps> = ({
}) => {
const target = serviceUrl(service);
for (const [key, value] of Object.entries(params)) {
target.searchParams.append(key, value);
target.searchParams.append(key, value as string);
}

if (!CONFIG.auth.preAuthExternalLinks) {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/routes/manage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ const Manage: React.FC = () => {
</Link>}
{user.canUseStudio && <ExternalLink
service={"STUDIO"}
params={{ "return.target": studioReturnUrl }}
params={{
"return.target": studioReturnUrl,
"return.label": "Tobira",
}}
fallback="link"
css={gridTile}
>
Expand Down

0 comments on commit a20ddcc

Please sign in to comment.