Skip to content

Commit

Permalink
fix(deploy-log-full): undefined package list
Browse files Browse the repository at this point in the history
  • Loading branch information
dr460nf1r3 committed Jun 26, 2024
1 parent e625b9e commit c6adb86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ <h1 class="text-center text-4xl font-extrabold text-maroon">Deployment log</h1>
id="toast-deployment"
role="alert"
>
<div class="text-sm font-normal"
>New deployment event! <a (click)="headToFullDeployments()" class="text-mauve">Check out.</a></div
>
<div class="text-sm font-normal">New deployment event!</div>
</div>
</div>
8 changes: 6 additions & 2 deletions frontend/src/app/deploy-log-full/deploy-log-full.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class DeployLogFullComponent implements AfterViewInit {
logAmount: number | undefined
requestedTooMany = false
currentType: DeploymentType = DeploymentType.ALL
firstLoad = true
protected readonly headToFullDeployments = headToFullDeployments

async ngAfterViewInit(): Promise<void> {
Expand All @@ -37,7 +38,7 @@ export class DeployLogFullComponent implements AfterViewInit {
async updateLogAmount(amount: number) {
const newDeployments = parseDeployments(await getDeployments(amount, this.currentType), this.currentType)

if (newDeployments[0].date !== this.latestDeployments[0].date) {
if (this.latestDeployments.length === 0 || newDeployments[0].name !== this.latestDeployments[0]?.name) {
this.latestDeployments = newDeployments

// Show if we requested too many deployments
Expand All @@ -46,12 +47,15 @@ export class DeployLogFullComponent implements AfterViewInit {

// Show a notification for a short time
const notification = document.getElementById("toast-deployment")
if (notification) {
if (notification && !this.firstLoad) {
notification.classList.remove("invisible")
setTimeout((): void => {
notification.classList.add("invisible")
}, 20000)
}
if (this.firstLoad) {
this.firstLoad = false
}
}
}

Expand Down

0 comments on commit c6adb86

Please sign in to comment.