File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,23 @@ const orgName = computed(() => route.params.org)
1515
1616const { isConnected } = useConnector ()
1717
18- // Fetch all packages in this org using the org packages API
19- const { data : results, status, error } = await useOrgPackages (orgName )
20-
21- if (status .value === ' error' && error .value ?.statusCode === 404 ) {
22- throw createError ({
23- statusCode: 404 ,
24- statusMessage: $t (' org.page.not_found' ),
25- message: $t (' org.page.not_found_message' , { name: orgName .value }),
26- })
27- }
18+ // Fetch all packages in this org using the org packages API (lazy to not block navigation)
19+ const { data : results, status, error } = useOrgPackages (orgName )
20+
21+ // Handle 404 errors reactively (since we're not awaiting)
22+ watch (
23+ [status , error ],
24+ ([newStatus , newError ]) => {
25+ if (newStatus === ' error' && newError ?.statusCode === 404 ) {
26+ showError ({
27+ statusCode: 404 ,
28+ statusMessage: $t (' org.page.not_found' ),
29+ message: $t (' org.page.not_found_message' , { name: orgName .value }),
30+ })
31+ }
32+ },
33+ { immediate: true },
34+ )
2835
2936const packages = computed (() => results .value ?.objects ?? [])
3037const packageCount = computed (() => packages .value .length )
You can’t perform that action at this time.
0 commit comments