mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
Fixed missing update if content of diff changes (#1714)
* Fixed missing update if content of diff changes * Add property to disable automatic refetch in diffs Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
This commit is contained in:
@@ -36,6 +36,7 @@ import styled from "styled-components";
|
||||
type Props = DiffObjectProps & {
|
||||
url: string;
|
||||
limit?: number;
|
||||
refetchOnWindowFocus?: boolean;
|
||||
};
|
||||
|
||||
type NotificationProps = {
|
||||
@@ -59,8 +60,8 @@ const PartialNotification: FC<NotificationProps> = ({ fetchNextPage, isFetchingN
|
||||
);
|
||||
};
|
||||
|
||||
const LoadingDiff: FC<Props> = ({ url, limit, ...props }) => {
|
||||
const { error, isLoading, data, fetchNextPage, isFetchingNextPage } = useDiff(url, { limit });
|
||||
const LoadingDiff: FC<Props> = ({ url, limit, refetchOnWindowFocus, ...props }) => {
|
||||
const { error, isLoading, data, fetchNextPage, isFetchingNextPage } = useDiff(url, { limit, refetchOnWindowFocus });
|
||||
const [t] = useTranslation("repos");
|
||||
|
||||
if (error) {
|
||||
@@ -86,7 +87,8 @@ const LoadingDiff: FC<Props> = ({ url, limit, ...props }) => {
|
||||
|
||||
LoadingDiff.defaultProps = {
|
||||
limit: 25,
|
||||
sideBySide: false
|
||||
sideBySide: false,
|
||||
refetchOnWindowFocus: true,
|
||||
};
|
||||
|
||||
export default LoadingDiff;
|
||||
|
||||
Reference in New Issue
Block a user