Skip to content

Commit 5f0e101

Browse files
committed
fix: skip success toast when GitHub import triggers upgrade modal
addAndIndex returns null when the upgrade modal is shown. The toast was firing unconditionally -- now only shows on successful add.
1 parent 76461e8 commit 5f0e101

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

frontend/src/components/dashboard/DashboardHome.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ export function DashboardHome() {
113113
setLoading(true)
114114
const repoId = await addAndIndex(repo.name, repo.clone_url, repo.default_branch)
115115

116-
if (repoId && repo === githubRepos[githubRepos.length - 1]) {
117-
setIndexingRepoId(repoId)
118-
setIndexingRepoName(repo.name)
119-
setShowIndexingModal(true)
116+
if (repoId) {
117+
if (repo === githubRepos[githubRepos.length - 1]) {
118+
setIndexingRepoId(repoId)
119+
setIndexingRepoName(repo.name)
120+
setShowIndexingModal(true)
121+
}
122+
toast.success(`Added ${repo.name}`)
120123
}
121-
toast.success(`Added ${repo.name}`)
122124
} catch (error) {
123125
toast.error(`Failed to import ${repo.name}`, {
124126
description: error instanceof Error ? error.message : 'Please try again',

0 commit comments

Comments
 (0)