changes acc. user intro + chdet for move image
This commit is contained in:
@@ -69,6 +69,9 @@ export class DeckListComponent implements OnInit {
|
||||
if (!this.activeDeck && this.decks.length > 0) {
|
||||
this.activeDeck = this.decks[0];
|
||||
}
|
||||
if (this.decks.length === 0) {
|
||||
this.activeDeck = null;
|
||||
}
|
||||
},
|
||||
error: err => console.error('Error loading decks', err),
|
||||
});
|
||||
@@ -100,7 +103,7 @@ export class DeckListComponent implements OnInit {
|
||||
next: () => {
|
||||
this.loadDecks();
|
||||
this.closeDeletePopover();
|
||||
this.activeDeck = this.decks[0];
|
||||
this.activeDeck = this.decks.length > 0 ? this.decks[0] : null;
|
||||
},
|
||||
error: err => console.error('Error deleting deck', err),
|
||||
});
|
||||
@@ -314,7 +317,21 @@ export class DeckListComponent implements OnInit {
|
||||
// Handler for the moveCompleted event
|
||||
onImageMoved(): void {
|
||||
this.imageToMove = null;
|
||||
this.loadDecks();
|
||||
// Speichere den Namen des aktiven Decks
|
||||
const activeDeckName = this.activeDeck?.name;
|
||||
|
||||
this.deckService.getDecks().subscribe({
|
||||
next: decks => {
|
||||
this.decks = decks;
|
||||
// Aktualisiere den activeDeck mit den neuen Daten
|
||||
if (activeDeckName) {
|
||||
this.activeDeck = this.decks.find(deck => deck.name === activeDeckName) || null;
|
||||
}
|
||||
// Force change detection
|
||||
this.cdr.detectChanges();
|
||||
},
|
||||
error: err => console.error('Error loading decks', err),
|
||||
});
|
||||
}
|
||||
|
||||
onFileChange(event: any): void {
|
||||
|
||||
Reference in New Issue
Block a user