links: return submit if no 'first item'
Fixes unfiled bug where creating a new collection returned a blank
screen.
@@ -48,7 +48,6 @@ export function LinkWindow(props: LinkWindowProps) {
}, [graph.size]);
const first = graph.peekLargest()?.[0];
-
const [,,ship, name] = association['app-path'].split('/');
const style = useMemo(() =>
@@ -60,6 +59,14 @@ export function LinkWindow(props: LinkWindowProps) {
alignItems: 'center'
}), []);
+ if (!first) {
+ return (
+ <Col key={0} mx="auto" mt="4" maxWidth="768px" width="100%" flexShrink={0} px={3}>
+ <LinkSubmit s3={props.s3} name={name} ship={ship.slice(1)} api={api} />
+ </Col>
+ );
+ }
+
return (
<VirtualScroller
ref={(l) => (virtualList.current = l ?? undefined)}
@@ -82,7 +89,7 @@ export function LinkWindow(props: LinkWindowProps) {
if(index.eq(first ?? bigInt.zero)) {
return (
<>
- <Col key={index.toString()} mx="auto" mt="4" maxWidth="768px" width="100%" flexShrink='0' px={3}>
+ <Col key={index.toString()} mx="auto" mt="4" maxWidth="768px" width="100%" flexShrink={0} px={3}>
<LinkSubmit s3={props.s3} name={name} ship={ship.slice(1)} api={api} />
</Col>
<LinkItem {...linkProps} />
