mirror of
https://github.com/outline/outline.git
synced 2026-08-03 13:27:25 +03:00
fix: Split view browser title (#13130)
This commit is contained in:
@@ -2,6 +2,7 @@ import { observer } from "mobx-react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import env from "~/env";
|
||||
import useStores from "~/hooks/useStores";
|
||||
import { useSplitView } from "./SplitView/context";
|
||||
import { useTeamContext } from "./TeamContext";
|
||||
|
||||
type Props = {
|
||||
@@ -16,6 +17,13 @@ const originalShortcutHref = document
|
||||
const PageTitle = ({ title, favicon }: Props) => {
|
||||
const { auth } = useStores();
|
||||
const team = useTeamContext() ?? auth.team;
|
||||
const { isFocused } = useSplitView();
|
||||
|
||||
// Only the focused pane of a split view titles the tab, otherwise the panes
|
||||
// compete and the title depends on which rendered last.
|
||||
if (!isFocused) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Helmet>
|
||||
|
||||
Reference in New Issue
Block a user