-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from ubiquity/revert-274-rewrite-transactions
- Loading branch information
Showing
25 changed files
with
455 additions
and
475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
static/scripts/rewards/render-transaction/claim-rewards-pagination.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { app } from "../app-state"; | ||
import { getMakeClaimButton } from "../toaster"; | ||
import { table } from "./read-claim-data-from-url"; | ||
import { renderTransaction } from "./render-transaction"; | ||
import { removeAllEventListeners } from "./utils"; | ||
|
||
const nextTxButton = document.getElementById("nextTx"); | ||
const prevTxButton = document.getElementById("prevTx"); | ||
|
||
export function claimRewardsPagination(rewardsCount: HTMLElement) { | ||
rewardsCount.innerHTML = `${app.rewardIndex + 1}/${app.claims.length} reward`; | ||
if (nextTxButton) nextTxButton.addEventListener("click", () => transactionHandler("next")); | ||
if (prevTxButton) prevTxButton.addEventListener("click", () => transactionHandler("previous")); | ||
} | ||
|
||
function transactionHandler(direction: "next" | "previous") { | ||
removeAllEventListeners(getMakeClaimButton()) as HTMLButtonElement; | ||
direction === "next" ? app.nextPermit() : app.previousPermit(); | ||
table.setAttribute(`data-make-claim`, "error"); | ||
renderTransaction().catch(console.error); | ||
} |
Oops, something went wrong.