Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Caojiahao-Coder committed Apr 29, 2024
2 parents c17d48a + 42fa62f commit 7b1dd7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/components/GroqSetting.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import { ref } from 'vue'
import { onMounted, ref } from 'vue'
import { groqApiKey, groqBaseURL, groqModel } from '@/store/localstorage'
import Dialog from '@/ui/Dialog.vue'
import { groq_models } from '@/assets/models-list'
Expand All @@ -12,6 +12,11 @@ const apiKey_modal = ref<string>(groqApiKey.value)
const groqModel_modal = ref<string>(groqModel.value)
const { t } = useI18n()
onMounted(() => {
if (groq_models.filter(a => a.value === groqModel.value).length === 0)
groqModel.value = groq_models[0].value
})
function onSaveOpenAIConfig() {
try {
if (!apiKey_modal.value || (apiKey_modal.value?.trim() ?? '').length === 0) {
Expand Down Expand Up @@ -110,7 +115,7 @@ function copyOpenAiKey() {
</div>

<div class="text-4 m-t-2" :class="groqModel.length <= 0 ? 'color-fade' : 'color-base'">
{{ groq_models.filter(a => a.value === groqModel)[0].name }}
{{ groq_models.filter(a => a.value === groqModel)[0]?.name }}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/LeftSideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function toggleOpenLeftSideBar() {
}
onMounted(() => {
document.getElementById('move-item')!.addEventListener('mousedown', (e: MouseEvent) => {
document.getElementById('move-item')?.addEventListener('mousedown', (e: MouseEvent) => {
const startX = e.clientX
const startWidth = document.getElementById('left-menu')!.offsetWidth
document.onmousemove = function (e) {
Expand Down

0 comments on commit 7b1dd7d

Please sign in to comment.