on master help sign in
fetch fresh hosting data for each ship
b9e8d4eLiam Fitzgerald
src/views/UrbitOS/Home.js+4−7
@@ -20,6 +20,7 @@ import BridgeForm from 'form/BridgeForm';
20import { useLocalRouter } from 'lib/LocalRouter';
20import { useLocalRouter } from 'lib/LocalRouter';
21import { useHosting } from 'store/hosting';
21import { useHosting } from 'store/hosting';
22import DownloadKeyfileButton from 'components/DownloadKeyfileButton';
22import DownloadKeyfileButton from 'components/DownloadKeyfileButton';
23+import useLifecycle from 'lib/useLifecycle';
23
24
24export default function UrbitOSHome({ manualNetworkSeed }) {
25export default function UrbitOSHome({ manualNetworkSeed }) {
25 const { pointCursor } = usePointCursor();
26 const { pointCursor } = usePointCursor();
@@ -102,13 +103,9 @@ function Hosting({ manualNetworkSeed }) {
102 disabled,
103 disabled,
103 } = ship;
104 } = ship;
104
105
105− const [synced, setSynced] = useState(false);
106+ useLifecycle(() => {
106− useEffect(() => {
107− if (unknown && !synced) {
108− syncStatus();
107+ syncStatus();
109− setSynced(true);
108+ });
110− }
111− }, [syncStatus, unknown, setSynced, synced]);
112
109
113 const createShip = useCallback(() => ship.create(keyfile), [keyfile, ship]);
110 const createShip = useCallback(() => ship.create(keyfile), [keyfile, ship]);
114
111