Skip to content

Commit 8ddfb65

Browse files
committed
fix: @coderabbitai suggested changes
1 parent e90a9a4 commit 8ddfb65

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

app/components/Org/TeamPackagesPanel.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import type { AccessPermission } from '#cli/types'
33
import { buildScopeTeam } from '~/utils/npm/common'
4+
import { packageRoute } from '~/utils/router'
45
56
const props = defineProps<{
67
orgName: string

app/components/Package/BulkGrantAccessModal.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const dialogRef = useTemplateRef('dialogRef')
3434
3535
// Load teams when modal opens
3636
async function loadTeams() {
37+
teams.value = []
3738
if (!isConnected.value) return
3839
3940
isLoadingTeams.value = true
@@ -47,6 +48,8 @@ async function loadTeams() {
4748
} else {
4849
loadError.value = connectorError.value || 'Failed to load teams'
4950
}
51+
} catch (err) {
52+
loadError.value = err instanceof Error ? err.message : 'Failed to load teams'
5053
} finally {
5154
isLoadingTeams.value = false
5255
}

app/components/Package/CopyAccessModal.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,21 @@ const teamCollaborators = computed(() => {
6060
async function loadCollaborators() {
6161
if (!isConnected.value || !sourcePackage.value) return
6262
63+
const requestedSource = sourcePackage.value
6364
isLoadingCollaborators.value = true
6465
loadError.value = null
6566
6667
try {
67-
const result = await listPackageCollaborators(sourcePackage.value)
68+
const result = await listPackageCollaborators(requestedSource)
69+
if (sourcePackage.value !== requestedSource) return
70+
6871
if (result) {
6972
collaborators.value = result
7073
} else {
7174
loadError.value = connectorError.value || 'Failed to load collaborators'
7275
}
76+
} catch (err) {
77+
loadError.value = err instanceof Error ? err.message : 'Failed to load collaborators'
7378
} finally {
7479
isLoadingCollaborators.value = false
7580
}

0 commit comments

Comments
 (0)