fix: version control panel - show correct state when a push is rejected (#23)

This commit is contained in:
Michael Cartner
2024-02-06 16:03:04 +01:00
committed by GitHub
parent 8a88290dab
commit 6e514f2521

View File

@@ -324,6 +324,11 @@ export function GitStatusButton({ openGitSettingsPopout }: GitStatusButtonProps)
}); });
} else { } else {
ToastLayer.showError('Failed to push. ' + error); ToastLayer.showError('Failed to push. ' + error);
// If the error is a rejected push, we need to fetch again to get the latest state where we can pull and rebase
if (error?.toString().includes('rejected')) {
await fetchRemote();
}
} }
return; return;