@@ -1,9 +1,10 @@
1−import React from 'react';
1+import React, { useEffect, useState } from 'react';
2import * as ob from 'urbit-ob';
2import * as ob from 'urbit-ob';
3import { Box } from '@tlon/indigo-react';
3import { Box } from '@tlon/indigo-react';
5import LayerIndicator from '../LayerIndicator';
5import LayerIndicator from '../LayerIndicator';
6import './IncomingPoint.scss';
6import './IncomingPoint.scss';
7+import useRoller from 'lib/useRoller';
8export interface IncomingPointProps {
9export interface IncomingPointProps {
9 point: number;
10 point: number;
@@ -12,6 +13,15 @@ export interface IncomingPointProps {
14const IncomingPoint = ({ point, accept, reject }: IncomingPointProps) => {
15const IncomingPoint = ({ point, accept, reject }: IncomingPointProps) => {
16+ const { api } = useRoller();
17+ const [layer, setLayer] = useState<1 | 2>(1);
20+ api.getPoint(point).then(p => {
21+ setLayer(p.dominion === 'l2' ? 2 : 1);
23+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
16 <Box className="incoming-point" key={`incoming-${point}`}>
26 <Box className="incoming-point" key={`incoming-${point}`}>
17 <Box className="top">
27 <Box className="top">
@@ -26,7 +36,7 @@ const IncomingPoint = ({ point, accept, reject }: IncomingPointProps) => {
28 <Box className="bottom">
38 <Box className="bottom">
29− <LayerIndicator layer={1} size="sm" />
39+ <LayerIndicator layer={layer} size="sm" />
30 <Box className="date"></Box>
40 <Box className="date"></Box>