Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur committed Oct 27, 2024
1 parent d7215f2 commit bc342e2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions ui2/src/features/document/components/customFields/Monetary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,25 @@ type MonetaryExtraDataType = {
currency: string
}

function getCurrency(extraData?: string): string | undefined {
function getCurrency(
extraData?: string | MonetaryExtraDataType
): string | undefined {
if (!extraData) {
return
}

const extra_data = JSON.parse(extraData) as MonetaryExtraDataType
if (typeof extraData == "string") {
const extra_data = JSON.parse(extraData) as MonetaryExtraDataType

if (extra_data) {
return extra_data.currency
if (extra_data) {
return extra_data.currency
}

return
}

if (extraData.currency) {
return extraData.currency
}

return
Expand Down

0 comments on commit bc342e2

Please sign in to comment.