Fix build issues.

This commit is contained in:
Tomas Groth 2022-07-26 23:29:33 +02:00
parent 8bb4a8a114
commit 5196f522dc
1 changed files with 18 additions and 18 deletions

View File

@ -13,58 +13,58 @@ import { StageViewComponent } from '../stage-view/stage-view.component';
})
export class ChordViewComponent extends StageViewComponent {
// Map with the song id and transpose value so the chord-view remembers the value for each song
let songTransposeMap = new Map();
transpose = 0;
songTransposeMap = new Map();
setNewSlides(slides: Slide[]): void {
super.setNewSlides(slides);
// if this song is already known
if (songTransposeMap.has(this.serviceItem.id))
if (this.songTransposeMap.has(this.serviceItem.id))
{
if (songTransposeMap.get(this.serviceItem.id) != 0)
if (this.songTransposeMap.get(this.serviceItem.id) != 0)
{
transpose();
this.transpose();
}
}
else
{
songTransposeMap.set(this.serviceItem.id, 0);
this.songTransposeMap.set(this.serviceItem.id, 0);
}
}
transposeUp(): void {
if (songTransposeMap.has(this.serviceItem.id))
if (this.songTransposeMap.has(this.serviceItem.id))
{
let tmpTranspose = songTransposeMap.get(this.serviceItem.id) + 1;
songTransposeMap.set(this.serviceItem.id, tmpTranspose);
let tmpTranspose = this.songTransposeMap.get(this.serviceItem.id) + 1;
this.songTransposeMap.set(this.serviceItem.id, tmpTranspose);
}
else
{
songTransposeMap.set(this.serviceItem.id, 1);
this.songTransposeMap.set(this.serviceItem.id, 1);
}
transpose();
this.transpose();
}
transposeDown(): void {
if (songTransposeMap.has(this.serviceItem.id))
if (this.songTransposeMap.has(this.serviceItem.id))
{
let tmpTranspose = songTransposeMap.get(this.serviceItem.id) - 1;
songTransposeMap.set(this.serviceItem.id, tmpTranspose);
let tmpTranspose = this.songTransposeMap.get(this.serviceItem.id) - 1;
this.songTransposeMap.set(this.serviceItem.id, tmpTranspose);
}
else
{
songTransposeMap.set(this.serviceItem.id, -1);
this.songTransposeMap.set(this.serviceItem.id, -1);
}
transpose();
this.transpose();
}
transpose(): void {
let tmpTranspose = songTransposeMap.get(this.serviceItem.id);
let tmpTranspose = this.songTransposeMap.get(this.serviceItem.id);
this.openlpService.transposeSong(tmpTranspose).subscribe(transposedLyrics => {
// Replace the chords in the currentSlides with the returned transposed chords
if (transposedLyrics instanceof Array) {
for (let i = 0; i < this.transposedLyrics.length; ++i) {
for (let i = 0; i < transposedLyrics.length; ++i) {
this.currentSlides[i].chords = transposedLyrics[i];
}
}