flow: various flow fixes

This commit is contained in:
Tom Moor committed 2021-03-15 18:49:43 -07:00
1 parent 4b540968dd
commit 4bdeb609e2
4 files changed
+8 -7

No files matched your search

-2
View File
@@ -93,8 +93,6 @@ class Layout extends React.Component<Props> {
@keydown("n")
goToNewDocument() {
if (this.props.ui.editMode) return;
const { activeCollectionId } = this.props.ui;
if (!activeCollectionId) return;
@@ -23,9 +23,9 @@ type Props = {|
canUpdate: boolean,
activeDocument: ?Document,
prefetchDocument: (id: string) => Promise<void>,
belowCollection: Collection | undefined,
belowCollection: Collection | void,
isAnyCollectionDragging: boolean,
setIsAnyCollectionDragging: () => void,
setIsAnyCollectionDragging: (dragging: boolean) => void,
|};
function CollectionLink({
+2 -2
View File
@@ -19,8 +19,8 @@ export default class Collection extends BaseModel {
sharing: boolean;
index: string;
documents: NavigationNode[];
createdAt: ?string;
updatedAt: ?string;
createdAt: string;
updatedAt: string;
deletedAt: ?string;
sort: { field: string, direction: "asc" | "desc" };
url: string;
+4 -1
View File
@@ -111,7 +111,10 @@ export default class CollectionsStore extends BaseStore<Collection> {
});
invariant(res && res.success, "Collection could not be moved");
const collection = this.get(collectionId);
collection.updateIndex(index);
if (collection) {
collection.updateIndex(index);
}
};
async update(params: Object): Promise<Collection> {