|
|
@@ -7,6 +7,7 @@ import type { Element } from 'react-markdown/lib/rehype-filter';
|
|
|
import {
|
|
|
useIsGuestUser, useIsReadOnlyUser, useIsSharedUser, useShareLinkId,
|
|
|
} from '~/stores/context';
|
|
|
+import { useIsRevisionOutdated } from '~/stores/page';
|
|
|
|
|
|
import styles from './TableWithEditButton.module.scss';
|
|
|
|
|
|
@@ -29,6 +30,7 @@ export const TableWithEditButton = React.memo((props: TableWithEditButtonProps):
|
|
|
const { data: isReadOnlyUser } = useIsReadOnlyUser();
|
|
|
const { data: isSharedUser } = useIsSharedUser();
|
|
|
const { data: shareLinkId } = useShareLinkId();
|
|
|
+ const { data: isRevisionOutdated } = useIsRevisionOutdated();
|
|
|
|
|
|
const bol = node.position?.start.line;
|
|
|
const eol = node.position?.end.line;
|
|
|
@@ -37,7 +39,7 @@ export const TableWithEditButton = React.memo((props: TableWithEditButtonProps):
|
|
|
globalEmitter.emit('launchHandsonTableModal', bol, eol);
|
|
|
}, [bol, eol]);
|
|
|
|
|
|
- const showEditButton = !isGuestUser && !isReadOnlyUser && !isSharedUser && shareLinkId == null;
|
|
|
+ const showEditButton = !isRevisionOutdated && !isGuestUser && !isReadOnlyUser && !isSharedUser && shareLinkId == null;
|
|
|
|
|
|
return (
|
|
|
<div className={`editable-with-handsontable ${styles['editable-with-handsontable']}`}>
|