File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export default {
39
39
return parseCodeblocks (this .doc .text )
40
40
},
41
41
createdAt () {
42
- if (this .$route . params . docId ) {
42
+ if (this .docId ) {
43
43
return moment (this .doc .createdAt ).format (' ddd, MMM Do, YYYY [at] h:mm A' )
44
44
}
45
45
@@ -49,7 +49,10 @@ export default {
49
49
return moment (this .doc .discardedAt ).format (' ddd, MMM Do, YYYY [at] h:mm A' )
50
50
},
51
51
doc () {
52
- return this .$store .getters .decrypted .find ((doc ) => doc .id === this .$route .params .docId )
52
+ return this .$store .getters .decrypted .find ((doc ) => doc .id === this .docId )
53
+ },
54
+ docId () {
55
+ return this .$router .currentRoute .value .params ? .docId
53
56
},
54
57
hasCodeblocks () {
55
58
return this .codeblocks .length > 0
@@ -65,7 +68,7 @@ export default {
65
68
})
66
69
},
67
70
savedAt () {
68
- if (this .$route . params . docId ) {
71
+ if (this .docId ) {
69
72
if (this .now .diff (this .doc .updatedAt , ' seconds' ) < 5 ) {
70
73
return ' just now'
71
74
} else {
@@ -76,7 +79,7 @@ export default {
76
79
return ' Not yet saved'
77
80
},
78
81
updatedAt () {
79
- if (this .$route . params . docId ) {
82
+ if (this .docId ) {
80
83
return moment (this .doc .updatedAt ).format (' ddd, MMM Do, YYYY [at] h:mm A' )
81
84
}
82
85
You can’t perform that action at this time.
0 commit comments