Skip to content

Commit 52550c6

Browse files
$subscribe store test
1 parent cb4dc7c commit 52550c6

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

src/components/panels/sidebar_preview_marc/Marc.vue

+8-8
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,23 @@
5252
5353
created() {
5454
55-
this.profileStore.$subscribe(async (mutation, state)=>{
55+
// this.profileStore.$subscribe(async (mutation, state)=>{
5656
57-
if (mutation && mutation.events && mutation.events.target && mutation.events.target['@guid'] ){
57+
// if (mutation && mutation.events && mutation.events.target && mutation.events.target['@guid'] ){
5858
59-
window.clearTimeout(this.timeout)
60-
this.timeout = window.setTimeout(()=>{
59+
// window.clearTimeout(this.timeout)
60+
// this.timeout = window.setTimeout(()=>{
6161
62-
this.refreshMarc()
62+
// this.refreshMarc()
6363
64-
},500)
64+
// },500)
6565
6666
6767
68-
}
68+
// }
6969
7070
71-
}, { detached: true })
71+
// }, { detached: true })
7272
7373
// build the XML on first load
7474
this.$nextTick(()=>{

src/components/panels/sidebar_preview_xml/Xml.vue

+14-14
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,31 @@
6565
6666
created() {
6767
68-
this.profileStore.$subscribe(async (mutation, state)=>{
68+
// this.profileStore.$subscribe(async (mutation, state)=>{
6969
70-
if (mutation && mutation.events && mutation.events.target && mutation.events.target['@guid'] ){
70+
// if (mutation && mutation.events && mutation.events.target && mutation.events.target['@guid'] ){
7171
72-
window.clearTimeout(this.timeout)
73-
this.timeout = window.setTimeout(()=>{
72+
// window.clearTimeout(this.timeout)
73+
// this.timeout = window.setTimeout(()=>{
7474
75-
this.refreshXml()
75+
// this.refreshXml()
7676
77-
},500)
77+
// },500)
7878
7979
8080
81-
}
81+
// }
8282
8383
84-
// if (state.profilesLoaded && Object.keys(state.activeProfile).length == 0){
85-
// // the profilesLoaded flipped and there is no active profile, so load the data
86-
// this.profileStore.loadRecordFromBackend(this.$route.params.recordId)
87-
// }else{
88-
// //console.error("profilesLoaded is never true, cannot load into data")
89-
// }
84+
// // if (state.profilesLoaded && Object.keys(state.activeProfile).length == 0){
85+
// // // the profilesLoaded flipped and there is no active profile, so load the data
86+
// // this.profileStore.loadRecordFromBackend(this.$route.params.recordId)
87+
// // }else{
88+
// // //console.error("profilesLoaded is never true, cannot load into data")
89+
// // }
9090
9191
92-
}, { detached: true })
92+
// }, { detached: true })
9393
9494
// build the XML on first load
9595
this.$nextTick(()=>{

src/views/Edit.vue

+14-6
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,26 @@
174174
created: function(){
175175
176176
177-
this.profileStore.$subscribe(async (mutation, state)=>{
178-
console.log(state.profilesLoaded, Object.keys(state.activeProfile).length)
177+
// this.profileStore.$subscribe(async (mutation, state)=>{
178+
// console.log(state.profilesLoaded, Object.keys(state.activeProfile).length)
179179
180-
if (state.profilesLoaded && Object.keys(state.activeProfile).length == 0){
180+
// if (state.profilesLoaded && Object.keys(state.activeProfile).length == 0){
181+
// // the profilesLoaded flipped and there is no active profile, so load the data
182+
// this.profileStore.loadRecordFromBackend(this.$route.params.recordId)
183+
// }else{
184+
// //console.error("profilesLoaded is never true, cannot load into data")
185+
// }
186+
187+
188+
// }, { detached: true })
189+
190+
if (state.profilesLoaded && Object.keys(state.activeProfile).length == 0){
181191
// the profilesLoaded flipped and there is no active profile, so load the data
182192
this.profileStore.loadRecordFromBackend(this.$route.params.recordId)
183193
}else{
184194
//console.error("profilesLoaded is never true, cannot load into data")
185195
}
186-
187-
188-
}, { detached: true })
196+
}
189197
190198
191199

0 commit comments

Comments
 (0)