Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix save existing songs from song preview #224

Merged
merged 2 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading