mirror of
https://github.com/outline/outline.git
synced 2026-12-02 09:42:07 +03:00
fix: MobX warnings
This commit is contained in:
3 files changed
+37
-35
No files matched your search
@@ -388,7 +388,6 @@ export default class Document extends ArchivableModel implements Searchable {
|
||||
return !this.publishedAt;
|
||||
}
|
||||
|
||||
@computed
|
||||
get hasEmptyTitle(): boolean {
|
||||
return this.title === "";
|
||||
}
|
||||
|
||||
@@ -120,7 +120,6 @@ export default class Template extends ParanoidModel implements Searchable {
|
||||
return !!this.deletedAt;
|
||||
}
|
||||
|
||||
@computed
|
||||
get hasEmptyTitle(): boolean {
|
||||
return this.title === "";
|
||||
}
|
||||
|
||||
@@ -182,40 +182,44 @@ function ReferenceListItem({
|
||||
);
|
||||
}
|
||||
|
||||
function ReferenceListItemContextMenu({
|
||||
document,
|
||||
children,
|
||||
handleMenuOpen,
|
||||
handleMenuClose,
|
||||
}: {
|
||||
document: Document;
|
||||
handleMenuOpen: () => void;
|
||||
handleMenuClose: () => void;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const { isShare } = useShare();
|
||||
const contextMenuAction = useDocumentMenuAction({ documentId: document.id });
|
||||
const ReferenceListItemContextMenu = observer(
|
||||
function ReferenceListItemContextMenu_({
|
||||
document,
|
||||
children,
|
||||
handleMenuOpen,
|
||||
handleMenuClose,
|
||||
}: {
|
||||
document: Document;
|
||||
handleMenuOpen: () => void;
|
||||
handleMenuClose: () => void;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const { isShare } = useShare();
|
||||
const contextMenuAction = useDocumentMenuAction({
|
||||
documentId: document.id,
|
||||
});
|
||||
|
||||
return (
|
||||
<ActionContextProvider
|
||||
value={{
|
||||
activeModels: [
|
||||
document,
|
||||
...(!isShare && document.collection ? [document.collection] : []),
|
||||
],
|
||||
}}
|
||||
>
|
||||
<ContextMenu
|
||||
action={contextMenuAction}
|
||||
ariaLabel={t("Document options")}
|
||||
onOpen={handleMenuOpen}
|
||||
onClose={handleMenuClose}
|
||||
return (
|
||||
<ActionContextProvider
|
||||
value={{
|
||||
activeModels: [
|
||||
document,
|
||||
...(!isShare && document.collection ? [document.collection] : []),
|
||||
],
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</ContextMenu>
|
||||
</ActionContextProvider>
|
||||
);
|
||||
}
|
||||
<ContextMenu
|
||||
action={contextMenuAction}
|
||||
ariaLabel={t("Document options")}
|
||||
onOpen={handleMenuOpen}
|
||||
onClose={handleMenuClose}
|
||||
>
|
||||
{children}
|
||||
</ContextMenu>
|
||||
</ActionContextProvider>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
export default observer(ReferenceListItem);
|
||||
Reference in new issue
Block a user