Attempt to use react router the way it was meant to
This commit is contained in:
parent
4aad98256a
commit
55c021796e
3 changed files with 63 additions and 57 deletions
|
@ -22,8 +22,8 @@ import subscriptionManager from "../app/SubscriptionManager";
|
|||
const ActionBar = (props) => {
|
||||
const location = useLocation();
|
||||
let title = "ntfy";
|
||||
if (props.selectedSubscription) {
|
||||
title = topicShortUrl(props.selectedSubscription.baseUrl, props.selectedSubscription.topic);
|
||||
if (props.selected) {
|
||||
title = topicShortUrl(props.selected.baseUrl, props.selected.topic);
|
||||
} else if (location.pathname === "/settings") {
|
||||
title = "Settings";
|
||||
}
|
||||
|
@ -50,8 +50,8 @@ const ActionBar = (props) => {
|
|||
<Typography variant="h6" noWrap component="div" sx={{ flexGrow: 1 }}>
|
||||
{title}
|
||||
</Typography>
|
||||
{props.selectedSubscription && <SettingsIcon
|
||||
subscription={props.selectedSubscription}
|
||||
{props.selected && <SettingsIcon
|
||||
subscription={props.selected}
|
||||
onUnsubscribe={props.onUnsubscribe}
|
||||
/>}
|
||||
</Toolbar>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue