Skip to content

Commit

Permalink
➕ Merge pull request #224 from devmount/bugs/save-existing-songs
Browse files Browse the repository at this point in the history
Fix save existing songs from song preview
  • Loading branch information
devmount authored Jul 13, 2024
2 parents 3074ce8 + da94b48 commit 438c083
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/modals/SetlistSet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
</secondary-button>
</template>
<div class="max-h-80 overflow-y-auto flex flex-col gap-0.5 !p-2 text-sm">
<secondary-button
<secondary-button
v-for="(l, k) in languages" :key="k"
@click="filter.language = k"
:class="{ '!bg-spring-700': k === filter.language }"
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/modals/SongSet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ import 'vue-prism-editor/dist/prismeditor.min.css';
import { keyScale, sdHighlight, throwError, urlify } from '@/utils.js';
import { notify } from '@kyvg/vue3-notification';
import { PrismEditor } from 'vue-prism-editor';
import { ref, reactive, computed, inject, watch } from 'vue';
import { ref, reactive, computed, inject, watch, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { setDoc, updateDoc, deleteDoc, doc } from 'firebase/firestore';
Expand Down Expand Up @@ -308,6 +308,7 @@ const initInput = () => {
song.value = {...props.initialSong};
};
watch(() => props.active, () => initInput());
onMounted(() => initInput());
// active modals state
const showModal = reactive({
Expand Down Expand Up @@ -336,7 +337,7 @@ const createSlug = () => {
return urlify(song.value.title) + '-' + song.value.language;
};
// add or save edits of song to db
// add or save edits of song to db
const busy = ref(false);
const setSong = () => {
const slug = createSlug();
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/views/SongShow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ const position = computed(() => props.ready.setlists && urlSetlist && urlKey
// get song object from db as soon as songs have finished loading
const song = computed(() => {
if (props.ready.songs) {
return props.songs[songId];
if (songId && props.ready.songs) {
return { ...props.songs[songId], id: songId };
}
return null;
});
Expand All @@ -401,7 +401,7 @@ const showLanguages = computed(() => {
languages.push([sId, props.songs[sId].language]);
}
}
return languages.sort((a, b) => {
return languages.sort((a, b) => {
return a[1] > b[1] ? 1 : -1;
})
} else {
Expand Down

0 comments on commit 438c083

Please sign in to comment.