diff --git a/web/src/components/ChatBox.vue b/web/src/components/ChatBox.vue index 3fdaddf1..c16d64f9 100644 --- a/web/src/components/ChatBox.vue +++ b/web/src/components/ChatBox.vue @@ -109,7 +109,7 @@ -
+
{ - const waitForPersonalities = setInterval(() => { - if (store.state.personalities) { - clearInterval(waitForPersonalities); - resolve(); - } - }, 100); - }); - this.personalities = store.state.personalities + nextTick(() => { + feather.replace() + }) + while (this.$store.state.personalities === null) { + await new Promise((resolve) => setTimeout(resolve, 100)); // Wait for 100ms + } + this.configFile = this.$store.state.config + this.personalities = this.$store.state.personalities console.log('personalities') console.log(this.personalities) - let personality_path_infos = store.state.config.personalities[store.state.config.active_personality_id] + let personality_path_infos = this.$store.state.config.personalities[this.$store.state.config.active_personality_id].split('/') console.log('personality_path_infos') console.log(personality_path_infos) - this.configFile.personality_language = personality_path_infos["personality_language"]; - this.configFile.personality_category = personality_path_infos["personality_category"]; - this.configFile.personality_folder = personality_path_infos["personality_name"]; - this.mountedPersArr = store.state.mountedPersArr + this.configFile.personality_language = personality_path_infos[0]; + this.configFile.personality_category = personality_path_infos[1]; + this.configFile.personality_folder = personality_path_infos[2]; + this.mountedPersArr = this.$store.state.mountedPersArr console.log(this.mountedPersArr); console.log("Ready") this.onReady(); @@ -133,8 +130,11 @@ export default { async getPersonalitiesArr() { this.personalities = [] - const dictionary = await this.api_get_req("get_all_personalities") - const config = await this.api_get_req("get_config") + while (this.$store.state.ready === false) { + await new Promise((resolve) => setTimeout(resolve, 100)); // Wait for 100ms + } + const dictionary = this.$store.state.personalities + const config = this.$store.state.config //this.configFile=config //console.log('asdas',config) // console.log("all_personalities") @@ -175,8 +175,6 @@ export default { this.personalities.sort((a, b) => a.name.localeCompare(b.name)) - - this.getMountedPersonalities() nextTick(()=>{ diff --git a/web/src/components/MountedPersonalitiesList.vue b/web/src/components/MountedPersonalitiesList.vue index ff6487e5..f2f97c2c 100644 --- a/web/src/components/MountedPersonalitiesList.vue +++ b/web/src/components/MountedPersonalitiesList.vue @@ -79,7 +79,7 @@ import defaultPersonalityImgPlaceholder from "../assets/logo.svg" import PersonalityEntry from './PersonalityEntry.vue' import Toast from './Toast.vue' import UniversalForm from './UniversalForm.vue'; - +import feather from 'feather-icons' import axios from "axios"; @@ -144,7 +144,7 @@ export default { console.log('personalities') console.log(this.personalities) - let personality_path_infos = store.state.config.personalities[store.state.config.active_personality_id] + let personality_path_infos = this.$store.state.config.personalities[this.$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"]; diff --git a/web/src/components/Navigation.vue b/web/src/components/Navigation.vue index 1222b98a..bcac607d 100644 --- a/web/src/components/Navigation.vue +++ b/web/src/components/Navigation.vue @@ -1,5 +1,5 @@