From f0f4f8f920417dc613da489f54e1ed6d564d755f Mon Sep 17 00:00:00 2001 From: Mononaut Date: Thu, 4 May 2023 14:16:09 -0400 Subject: [PATCH] Announce difficulty locked in on last block of epoch --- .../components/difficulty/difficulty.component.html | 1 + .../components/difficulty/difficulty.component.scss | 12 ++++++++++++ .../components/difficulty/difficulty.component.ts | 2 ++ 3 files changed, 15 insertions(+) diff --git a/frontend/src/app/components/difficulty/difficulty.component.html b/frontend/src/app/components/difficulty/difficulty.component.html index 27cddc043..7ce36f685 100644 --- a/frontend/src/app/components/difficulty/difficulty.component.html +++ b/frontend/src/app/components/difficulty/difficulty.component.html @@ -33,6 +33,7 @@ repeatCount="indefinite"/> + Difficulty adjustment locked in
diff --git a/frontend/src/app/components/difficulty/difficulty.component.scss b/frontend/src/app/components/difficulty/difficulty.component.scss index 1da1591d0..a948dc9b4 100644 --- a/frontend/src/app/components/difficulty/difficulty.component.scss +++ b/frontend/src/app/components/difficulty/difficulty.component.scss @@ -172,6 +172,18 @@ width: 100%; height: 22px; margin-bottom: 12px; + position: relative; + + .lock-in-msg { + position: absolute; + left: 0; + right: 0; + top: 0; + font-size: 12px; + line-height: 22px; + width: 100%; + text-align: center; + } } .epoch-blocks { diff --git a/frontend/src/app/components/difficulty/difficulty.component.ts b/frontend/src/app/components/difficulty/difficulty.component.ts index b246a14fe..4982df16b 100644 --- a/frontend/src/app/components/difficulty/difficulty.component.ts +++ b/frontend/src/app/components/difficulty/difficulty.component.ts @@ -54,6 +54,7 @@ export class DifficultyComponent implements OnInit { expectedHeight: number; expectedIndex: number; difference: number; + lockedIn: boolean = false; shapes: DiffShape[]; tooltipPosition = { x: 0, y: 0 }; @@ -104,6 +105,7 @@ export class DifficultyComponent implements OnInit { this.currentIndex = this.currentHeight - this.epochStart; this.expectedIndex = Math.min(this.expectedHeight - this.epochStart, 2016) - 1; this.difference = this.currentIndex - this.expectedIndex; + this.lockedIn = this.currentIndex === 2015; this.shapes = []; this.shapes = this.shapes.concat(this.blocksToShapes(