fix: cloud sync toasts (#10070)

(cherry picked from commit b7774b0173)
This commit is contained in:
Ryan Willis
2026-06-11 23:26:35 -07:00
committed by Insomnia
parent fa714b61be
commit b060bef746

View File

@@ -108,7 +108,11 @@ export const SyncDropdown: FC<Props> = () => {
useEffect(() => {
if (pushFetcher.data && 'error' in pushFetcher.data && pushFetcher.data.error) {
setOperationError(pushFetcher.data.error);
showToast({ icon: cloudSyncIcon, title: `Push failed` });
showToast({
icon: cloudSyncIcon,
title: `Push failed`,
status: 'error',
});
} else if (pushFetcher.data && 'success' in pushFetcher.data && pushFetcher.data.success) {
showToast({
icon: cloudSyncIcon,
@@ -121,7 +125,11 @@ export const SyncDropdown: FC<Props> = () => {
useEffect(() => {
if (pullFetcher.data && 'error' in pullFetcher.data && pullFetcher.data.error) {
setOperationError(pullFetcher.data.error);
showToast({ icon: cloudSyncIcon, title: `Pull failed` });
showToast({
icon: cloudSyncIcon,
title: `Pull failed`,
status: 'error',
});
} else if (pullFetcher.data && 'success' in pullFetcher.data && pullFetcher.data.success) {
showToast({
icon: cloudSyncIcon,
@@ -272,11 +280,7 @@ export const SyncDropdown: FC<Props> = () => {
isDisabled: compare.behind === 0 || pullFetcher.state !== 'idle',
action: () => {
setOperationError(null);
showToast({
icon: cloudSyncIcon,
title: `Pull failed`,
status: 'error',
});
showToast({ icon: cloudSyncIcon, title: `Pull started` });
pullFetcher.submit({
organizationId,
projectId,