Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit ee5504e

Browse files
don't display the equivalent of the self link since we already have self
1 parent dde4284 commit ee5504e

File tree

1 file changed

+5
-0
lines changed
  • src/components/HyperMediaControls

1 file changed

+5
-0
lines changed

src/components/HyperMediaControls/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { connect, createState } from '../../reactive';
44
import { navigation, store } from '../../stream-store';
55
import LinkButton from './LinkButton';
66
import FormButton from './FormButton';
7+
import { rels } from '../../stream-store';
8+
9+
const isNotSelf = (rel, links) =>
10+
links[rels.self] && links[rel].href !== links[rels.self].href;
711

812
const state$ = createState(store.url$.map(url => ['url', () => url]));
913

@@ -13,6 +17,7 @@ const HyperMediaControls = ({ forms, url, actions, links, onNavigate }) => (
1317
<div>
1418
{Object.keys(links)
1519
.filter(rel => !navigation.has(rel))
20+
.filter(rel => isNotSelf(rel, links))
1621
.map(rel => (
1722
<LinkButton
1823
key={rel}

0 commit comments

Comments
 (0)