This commit is contained in:
Saifeddine ALOUI 2023-07-09 19:40:51 +02:00
parent 611f7997ec
commit e615d12d8e
3 changed files with 5 additions and 14 deletions

View File

@ -13,9 +13,9 @@
@click.stop="toggleShowPersList" title="Click to show more">+{{ mountedPersArr.length - 1 }}</div>
</div>
<div class="flex -space-x-4 " v-if="mountedPersArr.length == 1">
<img :src="bUrl + mountedPers.avatar" @error="personalityImgPlacehodler"
<img :src="bUrl + this.$store.state.mountedPers.avatar" @error="personalityImgPlacehodler"
class="w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 cursor-pointer border-secondary"
:title="'Active personality: '+mountedPers.name" @click.stop="toggleShowPersList" >
:title="'Active personality: '+this.$store.state.mountedPers.name" @click.stop="toggleShowPersList" >
</div>
<div v-if="mountedPersArr.length == 0" title="Loading personalities">
<!-- SPINNER -->
@ -98,7 +98,7 @@ export default {
console.log('personalities')
console.log(this.personalities)
let personality_path_infos = store.state.personality_path_infos
let personality_path_infos = store.state.config.personalities[store.state.config.active_personality_id]
console.log('personality_path_infos')
console.log(personality_path_infos)
this.configFile.personality_language = personality_path_infos["personality_language"];

View File

@ -35,7 +35,7 @@
</label>
<div class="overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96">
<TransitionGroup name="bounce">
<personality-entry ref="personalitiesZoo" v-for="(pers, index) in mountedPersArr"
<personality-entry ref="personalitiesZoo" v-for="(pers, index) in this.$store.state.mountedPersArr"
:key="'index-' + index + '-' + pers.name" :personality="pers" :full_path="pers.full_path"
:selected="configFile.personalities[configFile.active_personality_id] === pers.full_path"
:on-selected="onPersonalitySelected" :on-mounted="onPersonalityMounted"
@ -144,7 +144,7 @@ export default {
console.log('personalities')
console.log(this.personalities)
let personality_path_infos = this.$store.state.personality_path_infos
let personality_path_infos = store.state.config.personalities[store.state.config.active_personality_id]
console.log('personality_path_infos')
console.log(personality_path_infos)
this.configFile.personality_language = personality_path_infos["personality_language"];

View File

@ -20,7 +20,6 @@ export const store = createStore({
config:null,
mountedPers:null,
personalities:null,
personality_path_infos:null
}
},
mutations: {
@ -33,9 +32,6 @@ export const store = createStore({
setMountedPers(state, mountedPers) {
state.mountedPers = mountedPers;
},
setPersonalityPathInfos(state, personality_path_infos) {
state.personality_path_infos = personality_path_infos;
}
// increment (state) {
// state.count++
@ -135,11 +131,6 @@ export const store = createStore({
this.state.mountedPers = this.state.personalities[this.state.personalities.findIndex(item => item.full_path == this.state.config.personalities[this.state.config.active_personality_id])]
},
async refreshPersonalityPath({ commit }){
this.state.personality_path_infos = await api_get_req("get_current_personality_path_infos")
}
}
})
async function api_get_req(endpoint) {