Skip to content

Commit

Permalink
fix: Add N/A label for no query and response even (#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
janmichek authored Oct 24, 2024
1 parent 40382f4 commit 4150fc1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/components/OracleEventsQueryPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
Query
</dt>
<dd class="oracle-events-query-panel__description">
{{ event.query }}
<template v-if="event.query">
{{ event.query }}
</template>
<not-available-label v-else/>
</dd>

<dt class="oracle-events-query-panel_term">
Expand All @@ -49,7 +52,10 @@
Response
</dt>
<dd class="oracle-events-query-panel__description">
{{ event.response }}
<template v-if="event.response">
{{ event.response }}
</template>
<not-available-label v-else/>
</dd>
</dl>
</app-panel>
Expand Down
8 changes: 7 additions & 1 deletion src/utils/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ export function formatNullable(value) {
}

export function formatDecodeBase64(base64String) {
return process.client ? window.atob(base64String) : Buffer.from(base64String, 'base64').toString('utf8')
try {
return process.client
? (decodeURIComponent(escape(atob(base64String))) ? decodeURIComponent(escape(atob(base64String))) : null)
: Buffer.from(base64String, 'base64').toString('utf8')
} catch (e) {
return ''
}
}

export function formatDecodeByteArray(bytesArray) {
Expand Down

0 comments on commit 4150fc1

Please sign in to comment.