@@ -1,9 +1,10 @@
1−import React from 'react';
1+import React, { useEffect, useState } from 'react';
22import * as ob from 'urbit-ob';
33import { Box } from '@tlon/indigo-react';
44
55import LayerIndicator from '../LayerIndicator';
66import './IncomingPoint.scss';
7+import useRoller from 'lib/useRoller';
78
89export interface IncomingPointProps {
910 point: number;
@@ -12,6 +13,15 @@ export interface IncomingPointProps {
1213}
1314
1415const IncomingPoint = ({ point, accept, reject }: IncomingPointProps) => {
16+ const { api } = useRoller();
17+ const [layer, setLayer] = useState<1 | 2>(1);
18+
19+ useEffect(() => {
20+ api.getPoint(point).then(p => {
21+ setLayer(p.dominion === 'l2' ? 2 : 1);
22+ });
23+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
24+
1525 return (
1626 <Box className="incoming-point" key={`incoming-${point}`}>
1727 <Box className="top">
@@ -26,7 +36,7 @@ const IncomingPoint = ({ point, accept, reject }: IncomingPointProps) => {
2636 </Box>
2737 </Box>
2838 <Box className="bottom">
29− <LayerIndicator layer={1} size="sm" />
39+ <LayerIndicator layer={layer} size="sm" />
3040 <Box className="date"></Box>
3141 </Box>
3242 </Box>