fix: Cannot create collection if all existing collections are deleted (#3836)
This commit is contained in:
@@ -153,7 +153,6 @@ class PaginatedList<T extends PaginatedItem> extends React.Component<Props<T>> {
|
||||
renderHeading,
|
||||
renderError,
|
||||
onEscape,
|
||||
children,
|
||||
} = this.props;
|
||||
|
||||
const showLoading =
|
||||
@@ -224,7 +223,6 @@ class PaginatedList<T extends PaginatedItem> extends React.Component<Props<T>> {
|
||||
});
|
||||
}}
|
||||
</ArrowKeyNavigation>
|
||||
{children}
|
||||
{this.allowLoadMore && (
|
||||
<Waypoint key={this.renderCount} onEnter={this.loadMoreResults} />
|
||||
)}
|
||||
|
||||
@@ -8,7 +8,6 @@ import Collection from "~/models/Collection";
|
||||
import Flex from "~/components/Flex";
|
||||
import Error from "~/components/List/Error";
|
||||
import PaginatedList from "~/components/PaginatedList";
|
||||
import Text from "~/components/Text";
|
||||
import { createCollection } from "~/actions/definitions/collections";
|
||||
import useStores from "~/hooks/useStores";
|
||||
import DraggableCollectionLink from "./DraggableCollectionLink";
|
||||
@@ -63,11 +62,6 @@ function Collections() {
|
||||
/>
|
||||
) : undefined
|
||||
}
|
||||
empty={
|
||||
<Empty type="tertiary" size="small">
|
||||
{t("Empty")}
|
||||
</Empty>
|
||||
}
|
||||
renderError={(props) => <StyledError {...props} />}
|
||||
renderItem={(item: Collection, index) => (
|
||||
<DraggableCollectionLink
|
||||
@@ -78,22 +72,14 @@ function Collections() {
|
||||
belowCollection={orderedCollections[index + 1]}
|
||||
/>
|
||||
)}
|
||||
>
|
||||
<SidebarAction action={createCollection} depth={0} />
|
||||
</PaginatedList>
|
||||
/>
|
||||
<SidebarAction action={createCollection} depth={0} />
|
||||
</Relative>
|
||||
</Header>
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
|
||||
const Empty = styled(Text)`
|
||||
margin-left: 36px;
|
||||
margin-bottom: 0;
|
||||
line-height: 34px;
|
||||
font-style: italic;
|
||||
`;
|
||||
|
||||
const StyledError = styled(Error)`
|
||||
font-size: 15px;
|
||||
padding: 0 8px;
|
||||
|
||||
@@ -160,10 +160,10 @@
|
||||
"Move document": "Move document",
|
||||
"You can't reorder documents in an alphabetically sorted collection": "You can't reorder documents in an alphabetically sorted collection",
|
||||
"Collections": "Collections",
|
||||
"Empty": "Empty",
|
||||
"Untitled": "Untitled",
|
||||
"New nested document": "New nested document",
|
||||
"Document not supported – try Markdown, Plain text, HTML, or Word": "Document not supported – try Markdown, Plain text, HTML, or Word",
|
||||
"Empty": "Empty",
|
||||
"Starred documents could not be loaded": "Starred documents could not be loaded",
|
||||
"Starred": "Starred",
|
||||
"Show more": "Show more",
|
||||
|
||||
Reference in New Issue
Block a user