mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Improve toast message for new branch push
This commit is contained in:
1 parent
933530a96c
commit
4d88823c2d
1 file changed
+12
-6
@@ -616,12 +616,18 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const commitCount = gitStatus.remoteBranchExists ? gitStatus.ahead : gitStatus.totalCommits;
|
// Show different messages for publishing new branches vs pushing commits
|
||||||
const action = gitStatus.remoteBranchExists ? 'pushed to' : 'published to';
|
if (gitStatus.remoteBranchExists) {
|
||||||
toast({
|
toast({
|
||||||
title: "Push successful",
|
title: "Push successful",
|
||||||
description: `${commitCount} commit${commitCount !== 1 ? 's' : ''} ${action} ${remote.name}/${gitStatus.currentBranch}`,
|
description: `${gitStatus.ahead} commit${gitStatus.ahead !== 1 ? 's' : ''} pushed to ${remote.name}/${gitStatus.currentBranch}`,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
toast({
|
||||||
|
title: "Branch published",
|
||||||
|
description: `New branch published to ${remote.name}/${gitStatus.currentBranch}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Refresh git status after push
|
// Refresh git status after push
|
||||||
await refetchGitStatus();
|
await refetchGitStatus();
|
||||||
|
|||||||
Reference in new issue
Block a user