on master help sign in
Merge pull request #317 from urbit/login-loading
c31b9a7Anthony Arroyo
src/views/Points.js+20−7
@@ -11,7 +11,7 @@ import { usePointCursor } from 'store/pointCursor';
11import * as need from 'lib/need';
11import * as need from 'lib/need';
12import { isZeroAddress, abbreviateAddress } from 'lib/wallet';
12import { isZeroAddress, abbreviateAddress } from 'lib/wallet';
13import useIsEclipticOwner from 'lib/useIsEclipticOwner';
13import useIsEclipticOwner from 'lib/useIsEclipticOwner';
14−import { useSyncKnownPoints } from 'lib/useSyncPoints';
14+import { useSyncKnownPoints, useSyncOwnedPoints } from 'lib/useSyncPoints';
15import useRejectedIncomingPointTransfers from 'lib/useRejectedIncomingPointTransfers';
15import useRejectedIncomingPointTransfers from 'lib/useRejectedIncomingPointTransfers';
16import pluralize from 'lib/pluralize';
16import pluralize from 'lib/pluralize';
17
17
@@ -196,6 +196,8 @@ export default function Points() {
196 ...spawningPoints,
196 ...spawningPoints,
197 ]);
197 ]);
198
198
199+ useSyncOwnedPoints(ownedPoints);
200+
199 const goCreateGalaxy = useCallback(() => push(names.CREATE_GALAXY), [
201 const goCreateGalaxy = useCallback(() => push(names.CREATE_GALAXY), [
200 names.CREATE_GALAXY,
202 names.CREATE_GALAXY,
201 push,
203 push,
@@ -206,6 +208,23 @@ export default function Points() {
206 push,
208 push,
207 ]);
209 ]);
208
210
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+
209 return (
228 return (
210 <View pop={pop} inset>
229 <View pop={pop} inset>
211 <Grid>
230 <Grid>
@@ -215,12 +234,6 @@ export default function Points() {
215 </CopiableAddress>
234 </CopiableAddress>
216 </Grid.Item>
235 </Grid.Item>
217
236
218− {loading && (
219− <Grid.Item full as={HelpText} className="mt8 t-center">
220− <Blinky /> Loading...
221− </Grid.Item>
222− )}
223−
224 {displayEmptyState && (
237 {displayEmptyState && (
225 <Grid.Item full as={HelpText} className="mt8 t-center">
238 <Grid.Item full as={HelpText} className="mt8 t-center">
226 No points to display. This wallet is not the owner or proxy for any
239 No points to display. This wallet is not the owner or proxy for any