File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ const router = new VueRouter({
54
54
{
55
55
component : StepperView ,
56
56
path : '' ,
57
+ props : true ,
57
58
children : [
58
59
{
59
60
name : 'Submission root' ,
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import OrcidId from '@/components/Presentation/OrcidId.vue';
6
6
7
7
import { stateRefs } from ' @/store' ;
8
8
import { getSubmissionLockedBy } from ' ./store' ;
9
- import { useRouter } from ' @/use/useRouter' ;
10
9
import { unlockSubmission } from ' ./store/api' ;
11
10
12
11
export default defineComponent ({
@@ -19,9 +18,7 @@ export default defineComponent({
19
18
},
20
19
},
21
20
22
- setup() {
23
- const router = useRouter ();
24
-
21
+ setup(props ) {
25
22
const loggedInUserHasLock = computed (() => {
26
23
const lockedByUser = getSubmissionLockedBy ();
27
24
if (! lockedByUser ) {
@@ -33,17 +30,12 @@ export default defineComponent({
33
30
return false ;
34
31
});
35
32
36
- const isEditingSubmission = computed (() => {
37
- if (router ) {
38
- return !! router .currentRoute .params .id ;
39
- }
40
- return false ;
41
- });
33
+ const isEditingSubmission = computed (() => props .id !== null );
42
34
43
35
window .addEventListener (' beforeunload' , () => {
44
36
if (isEditingSubmission .value ) {
45
- if (router ) {
46
- unlockSubmission (router . currentRoute . params .id );
37
+ if (props . id ) {
38
+ unlockSubmission (props .id );
47
39
}
48
40
}
49
41
});
You can’t perform that action at this time.
0 commit comments