Skip to content

Commit

Permalink
fix: ts
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
  • Loading branch information
panteleymonchuk committed Jan 29, 2024
1 parent c436792 commit 36a0e53
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/app/routes/stardust/TransactionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const TransactionPage: React.FC<RouteComponentProps<TransactionPageProps>> = ({

const outputsWithExtraInfo = React.useMemo(() => {
if (!outputs) return null;
return outputs.map((output, idx) => {
return outputs.map((output) => {
const extraInfo = inputsExtraInfo[output.id];
return {
...output,
Expand All @@ -75,7 +75,7 @@ const TransactionPage: React.FC<RouteComponentProps<TransactionPageProps>> = ({

const inputsWithExtraInfo = React.useMemo(() => {
if (!inputs) return null;
return inputs.map((input, idx) => {
return inputs.map((input) => {
const extraInfo = inputsExtraInfo[input.outputId];
return {
...input,
Expand All @@ -85,8 +85,10 @@ const TransactionPage: React.FC<RouteComponentProps<TransactionPageProps>> = ({
}, [inputs, inputsExtraInfo]);

const updateInputExtraInfo = async (input: IInput) => {
const commonOutput = input.output?.output as CommonOutput;

if (!isExpirationExists(input)) {
const indexes = getUnlockConditionIndexes(input, UnlockConditionType.Address);
const indexes = getUnlockConditionIndexes(commonOutput, UnlockConditionType.Address);
setInputsExtraInfo((prev) => ({
...prev,
[input.outputId]: {
Expand All @@ -98,7 +100,6 @@ const TransactionPage: React.FC<RouteComponentProps<TransactionPageProps>> = ({

const expirationUnlockCondition = getUnlockCondition(input, UnlockConditionType.Expiration) as ExpirationUnlockCondition;
const expirationConditionTimestamp = expirationUnlockCondition.unixTime * 1000;
const commonOutput = input.output?.output as CommonOutput;

if (!isOutputSpent(input)) {
const isExpired = DateHelper.isExpired(expirationConditionTimestamp);
Expand Down

0 comments on commit 36a0e53

Please sign in to comment.