Skip to content

Commit f432f6c

Browse files
committed
fix(persist-data): persisting data even if user lands on diff view directly
so now user can click on back button and have data in editors in all cases
1 parent 4847c83 commit f432f6c

File tree

1 file changed

+9
-27
lines changed

1 file changed

+9
-27
lines changed

pages/v2/diff.vue

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,16 @@
66
<main class="outline-none" tabindex="0">
77
<DiffActionBar :diff-navigator="diffNavigator" />
88
<section
9-
class="
10-
flex flex-wrap
11-
items-stretch
12-
w-full
13-
gap-4
14-
font-mono
15-
text-gray-800
16-
dark:text-gray-50
17-
"
9+
class="flex flex-wrap items-stretch w-full gap-4 font-mono text-gray-800 dark:text-gray-50"
1810
>
1911
<div class="flex w-full gap-4 space-around">
2012
<p
21-
class="
22-
flex-grow-0 flex-shrink-0
23-
w-1/2
24-
text-lg
25-
font-bold
26-
text-center
27-
capitalize
28-
break-all
29-
"
13+
class="flex-grow-0 flex-shrink-0 w-1/2 text-lg font-bold text-center capitalize break-all "
3014
>
3115
<span class="inline-block w-4/5">{{ lhsLabel }}</span>
3216
</p>
3317
<p
34-
class="
35-
flex-grow-0 flex-shrink-0
36-
w-1/2
37-
text-lg
38-
font-bold
39-
text-center
40-
capitalize
41-
break-all
42-
"
18+
class="flex-grow-0 flex-shrink-0 w-1/2 text-lg font-bold text-center capitalize break-all "
4319
>
4420
<span class="inline-block w-4/5">{{ rhsLabel }}</span>
4521
</p>
@@ -132,6 +108,12 @@ export default Vue.extend({
132108
}
133109
)
134110
}
111+
this.$store.commit('data/set', {
112+
lhs: this.lhs,
113+
rhs: this.rhs,
114+
lhsLabel: this.lhsLabel,
115+
rhsLabel: this.rhsLabel,
116+
})
135117
}
136118
})
137119
},

0 commit comments

Comments
 (0)