Skip to content

Commit 33b1ec8

Browse files
authored
Merge pull request #12 from devforth/feature/AdminForth/292/add-ability-to-store-county-is
fix: handle empty diff case and display message when no changes are p…
2 parents ec52a0f + 0ba3cf8 commit 33b1ec8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

custom/AuditLogView.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const newContent = JSON.stringify(props.record[props.meta.resourceColumns.resour
1717
const diffFile = ref();
1818
1919
function initDiffFile() {
20+
if ( Object.keys(JSON.parse(oldContent)).length === 0 && Object.keys(JSON.parse(newContent)).length === 0 ) {
21+
return
22+
}
2023
const file = generateDiffFile(
2124
'diff.json',
2225
oldContent,
@@ -51,12 +54,14 @@ watch([mode, theme], ([m, t]) => {
5154

5255
<template>
5356
<DiffView
57+
v-if="diffFile"
5458
:diff-file="diffFile"
5559
:diff-view-mode="mode"
5660
:diff-view-theme="theme === 'dark' ? 'dark' : 'light'"
5761
:diff-view-highlight="true"
5862
:diff-view-wrap="true"
5963
:diff-view-font-size="14"
6064
/>
65+
<p v-else>No changes to display.</p>
6166
</template>
6267

0 commit comments

Comments
 (0)