fix: has local backup icon appearing when local backups are disabled (#876)
This commit is contained in:
parent
48b472163f
commit
8d79994954
@ -101,6 +101,10 @@ const EntryCard: FC<TranslatedProps<EntryCardProps>> = ({
|
||||
|
||||
const [hasLocalBackup, setHasLocalBackup] = useState(false);
|
||||
useEffect(() => {
|
||||
if (config?.disable_local_backup) {
|
||||
return;
|
||||
}
|
||||
|
||||
let alive = true;
|
||||
|
||||
const checkLocalBackup = async () => {
|
||||
@ -122,7 +126,7 @@ const EntryCard: FC<TranslatedProps<EntryCardProps>> = ({
|
||||
return () => {
|
||||
alive = false;
|
||||
};
|
||||
}, [collection.name, entry.slug]);
|
||||
}, [collection.name, config?.disable_local_backup, entry.slug]);
|
||||
|
||||
if (PreviewCardComponent) {
|
||||
return (
|
||||
|
@ -11,6 +11,7 @@ import {
|
||||
} from '@staticcms/core/lib/util/collection.util';
|
||||
import localForage from '@staticcms/core/lib/util/localForage';
|
||||
import { isNullish } from '@staticcms/core/lib/util/null.util';
|
||||
import { selectConfig } from '@staticcms/core/reducers/selectors/config';
|
||||
import { selectTheme } from '@staticcms/core/reducers/selectors/globalUI';
|
||||
import { useAppSelector } from '@staticcms/core/store/hooks';
|
||||
import TableCell from '../../common/table/TableCell';
|
||||
@ -43,6 +44,8 @@ const EntryRow: FC<TranslatedProps<EntryRowProps>> = ({
|
||||
|
||||
const fields = selectFields(collection, entry.slug);
|
||||
|
||||
const config = useAppSelector(selectConfig);
|
||||
|
||||
const templateName = useMemo(
|
||||
() => selectTemplateName(collection, entry.slug),
|
||||
[collection, entry.slug],
|
||||
@ -52,6 +55,10 @@ const EntryRow: FC<TranslatedProps<EntryRowProps>> = ({
|
||||
|
||||
const [hasLocalBackup, setHasLocalBackup] = useState(false);
|
||||
useEffect(() => {
|
||||
if (config?.disable_local_backup) {
|
||||
return;
|
||||
}
|
||||
|
||||
let alive = true;
|
||||
|
||||
const checkLocalBackup = async () => {
|
||||
@ -73,7 +80,7 @@ const EntryRow: FC<TranslatedProps<EntryRowProps>> = ({
|
||||
return () => {
|
||||
alive = false;
|
||||
};
|
||||
}, [collection.name, entry.slug]);
|
||||
}, [collection.name, config?.disable_local_backup, entry.slug]);
|
||||
|
||||
return (
|
||||
<TableRow className={entriesClasses['entry-listing-table-row']} to={path}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user