Skip to content

Commit

Permalink
remove faulty redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Jul 13, 2023
1 parent e2f8a96 commit 3a87d00
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/components/FilterBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
class:active={sor === $SortBy}
on:click={() => handleSort(sor)}
on:keydown={() => handleSort(sor)}
role="button"
tabindex="0"
>
{sor}
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/components/ThemeSwitch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
on:click={(e) => switchTheme(e)}
on:keydown={(e) => switchTheme(e)}
role="button"
tabindex="0"
>
<slot name="light" /> <span class="ms-1">Light</span>
</div>
Expand All @@ -46,6 +47,8 @@
title="dark"
on:click={(e) => switchTheme(e)}
on:keydown={(e) => switchTheme(e)}
role="button"
tabindex="0"
>
<slot name="dark" /> <span class="ms-1">Dark</span>
</div>
Expand All @@ -57,6 +60,8 @@
title="auto"
on:click={(e) => switchTheme(e)}
on:keydown={(e) => switchTheme(e)}
role="button"
tabindex="0"
>
<i class="fa-solid fa-adjust" /> <span class="ms-1">System</span>
</div>
Expand Down
19 changes: 7 additions & 12 deletions src/layouts/ResultsLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,11 @@ const releaseSHA = meta?.releases.find((release) => release.tag_name === version
const bucketName = 'nf-core-awsmegatests';
const prefix = `${pipeline}/results-${releaseSHA}/`;
const baseURL = `/${pipeline}/${version}/`;
if (!Astro.url.pathname.includes(baseURL + 'results/' + prefix)) {
return Astro.redirect(baseURL);
} else {
}
const pathParts = path.split('/');
let filename = Astro.url.searchParams.get('file');
const description = meta?.description;
const depth = pathParts.length;
let response;
let aws_response;
let isTruncated = bucketContents.length === 0;
if (bucketContents.length === 0) {
console.log('fetching bucket contents');
Expand All @@ -48,20 +43,20 @@ if (bucketContents.length === 0) {
});
while (isTruncated) {
response = await client.send(
aws_response = await client.send(
new ListObjectsV2Command({
Bucket: bucketName,
ContinuationToken: response?.NextContinuationToken,
ContinuationToken: aws_response?.NextContinuationToken,
Prefix: prefix,
})
);
if (response.KeyCount === 0) {
if (aws_response.KeyCount === 0) {
break;
}
if (response.Contents) {
bucketContents.push(...response.Contents);
if (aws_response.Contents) {
bucketContents.push(...aws_response.Contents);
isTruncated = response.IsTruncated;
isTruncated = aws_response.IsTruncated;
}
}
}
Expand Down

0 comments on commit 3a87d00

Please sign in to comment.