All files / packages/app/features/settings refresh-settings.tsx

100% Statements 6/6
100% Branches 0/0
100% Functions 2/2
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                  22x 247x 247x 247x 1x   247x              
import React from "react";
 
import { useQueryClient } from "@tanstack/react-query";
import { useTranslation } from "react-i18next";
 
import { Button } from "~components/button";
import { Icon } from "~components/icons";
import { Text } from "~components/text";
 
export const RefreshSettings: React.FC = () => {
	const { t } = useTranslation("settings");
	const queryClient = useQueryClient();
	const refetch = React.useCallback(() => {
		void queryClient.invalidateQueries({ refetchType: "all" });
	}, [queryClient]);
	return (
		<Button color="primary" onPress={refetch}>
			<Icon name="refresh" />
			<Text>{t("refresh.header")}</Text>
		</Button>
	);
};