on master help sign in
Merge pull request #590 from urbit/m/starrelease-error-handling
832e643fang
src/store/lib/useStarReleaseStore.js+2−2
@@ -49,8 +49,8 @@ export default function useStarRelease() {
49
49
50 _setDetails(Just(result));
50 _setDetails(Just(result));
51 } catch (e) {
51 } catch (e) {
52− _setDetails(Nothing());
52+ _setDetails(Just(null));
53− console.error(e);
53+ console.error('error fetching star release details', e);
54 }
54 }
55 }, [contracts, wallet]);
55 }, [contracts, wallet]);
56
56
src/views/Points.js+3−2
@@ -151,7 +151,8 @@ export default function Points() {
151 all.length === 1 &&
151 all.length === 1 &&
152 incoming.length === 0 &&
152 incoming.length === 0 &&
153 maybeOutgoingPoints.value.length === 0 &&
153 maybeOutgoingPoints.value.length === 0 &&
154+ (starReleaseDetails.value === null ||
154− starReleaseDetails.value.total === 0
155+ starReleaseDetails.value.total === 0)
155 ) {
156 ) {
156 setPointCursor(Just(all[0]));
157 setPointCursor(Just(all[0]));
157 popAndPush(names.POINT);
158 popAndPush(names.POINT);
@@ -196,7 +197,7 @@ export default function Points() {
196 !loading && incomingPoints.length === 0 && allPoints.length === 0;
197 !loading && incomingPoints.length === 0 && allPoints.length === 0;
197
198
198 const starReleasing = starReleaseDetails
199 const starReleasing = starReleaseDetails
199− .map(s => s.total > 0)
200+ .map(s => (s ? s.total > 0 : false))
200 .getOrElse(false);
201 .getOrElse(false);
201
202
202 useEffect(() => {
203 useEffect(() => {