on master help sign in
Merge pull request #317 from urbit/login-loading

Loading screen on points view

commitc31b9a7be364216f793110fa27c908ac9a500df5 authorAnthony Arroyo <anthony@tlon.io> dateWed 6 Nov 2019, 14:55 (7 years ago) parentf890ffae7fb533
1 file changed+20−7
src/views/Points.js+20−7
src/views/Points.js+20−7
@@ -11,7 +11,7 @@ import { usePointCursor } from 'store/pointCursor';
1111import * as need from 'lib/need';
1212import { isZeroAddress, abbreviateAddress } from 'lib/wallet';
1313import useIsEclipticOwner from 'lib/useIsEclipticOwner';
14−import { useSyncKnownPoints } from 'lib/useSyncPoints';
14+import { useSyncKnownPoints, useSyncOwnedPoints } from 'lib/useSyncPoints';
1515import useRejectedIncomingPointTransfers from 'lib/useRejectedIncomingPointTransfers';
1616import pluralize from 'lib/pluralize';
1717
@@ -196,6 +196,8 @@ export default function Points() {
196196 ...spawningPoints,
197197 ]);
198198
199+ useSyncOwnedPoints(ownedPoints);
200+
199201 const goCreateGalaxy = useCallback(() => push(names.CREATE_GALAXY), [
200202 names.CREATE_GALAXY,
201203 push,
@@ -206,6 +208,23 @@ export default function Points() {
206208 push,
207209 ]);
208210
211+ if (
212+ loading ||
213+ (allPoints.length === 1 &&
214+ incomingPoints.length === 0 &&
215+ outgoingPoints.length === 0)
216+ ) {
217+ return (
218+ <View inset pop={pop}>
219+ <Grid>
220+ <Grid.Item full as={HelpText} className="mt8 t-center">
221+ <Blinky /> Loading...
222+ </Grid.Item>
223+ </Grid>
224+ </View>
225+ );
226+ }
227+
209228 return (
210229 <View pop={pop} inset>
211230 <Grid>
@@ -215,12 +234,6 @@ export default function Points() {
215234 </CopiableAddress>
216235 </Grid.Item>
217236
218− {loading && (
219− <Grid.Item full as={HelpText} className="mt8 t-center">
220− <Blinky /> Loading...
221− </Grid.Item>
222− )}
223−
224237 {displayEmptyState && (
225238 <Grid.Item full as={HelpText} className="mt8 t-center">
226239 No points to display. This wallet is not the owner or proxy for any