mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-02 11:13:29 +00:00
refetch sync.enabled when sync is enabled (#2489)
This commit is contained in:
parent
1eb98cea67
commit
8a960c05f2
|
@ -53,7 +53,9 @@ export const Component = () => {
|
|||
className="text-nowrap"
|
||||
variant="accent"
|
||||
onClick={() => {
|
||||
dialogManager.create((dialogProps) => <SyncBackfillDialog {...dialogProps} />);
|
||||
dialogManager.create((dialogProps) => (
|
||||
<SyncBackfillDialog onEnabled={() => syncEnabled.refetch()} {...dialogProps} />
|
||||
));
|
||||
}}
|
||||
disabled={backfillSync.isLoading}
|
||||
>
|
||||
|
@ -89,7 +91,7 @@ export const Component = () => {
|
|||
);
|
||||
};
|
||||
|
||||
function SyncBackfillDialog(props: UseDialogProps) {
|
||||
function SyncBackfillDialog(props: UseDialogProps & { onEnabled: () => void }) {
|
||||
const form = useZodForm({ schema: z.object({}) });
|
||||
const dialog = useDialog(props);
|
||||
|
||||
|
@ -100,6 +102,7 @@ function SyncBackfillDialog(props: UseDialogProps) {
|
|||
form.handleSubmit(
|
||||
async () => {
|
||||
await enableSync.mutateAsync(null).then(() => (dialog.state.open = false));
|
||||
await props.onEnabled();
|
||||
},
|
||||
() => {}
|
||||
)();
|
||||
|
|
Loading…
Reference in a new issue