null & undefined handling

This commit is contained in:
Tim Olson
2024-01-07 23:12:57 -04:00
parent 8fabfe0d2b
commit 52a41c6f81
11 changed files with 52 additions and 20 deletions

View File

@@ -26,7 +26,7 @@ function invert() {
prefs.inverted[k] = !prefs.inverted[k]
}
const adjValue = computed(() => !base.value || !quote.value ? null : pairPrice(base.value, quote.value, props.value, props.decimals).toPrecision(5))
const adjValue = computed(() => props.value === null || props.value === undefined || !base.value || !quote.value ? null : pairPrice(base.value, quote.value, props.value, props.decimals).toPrecision(5))
const pair = computed(() => {
const inToken = props.baseToken ? props.baseToken : token(props.baseAddr)