feat: füge sicheres Backup des alten Frontends hinzu und verbessere Fehlerbehandlung in normalizePool
All checks were successful
Deploy to production / deploy (push) Successful in 1m59s
All checks were successful
Deploy to production / deploy (push) Successful in 1m59s
This commit is contained in:
@@ -57,9 +57,12 @@ echo "✅ Build erfolgreich!"
|
||||
echo "Erstelle Zielverzeichnis..."
|
||||
sudo mkdir -p /opt/yourpart/frontend/dist
|
||||
|
||||
# 7. Altes Frontend löschen
|
||||
echo "Lösche altes Frontend..."
|
||||
sudo rm -rf /opt/yourpart/frontend/dist
|
||||
# 7. Sicheres Backup des alten Frontends (timestamped). Vermeidet Datenverlust bei Fehlern.
|
||||
if [ -d "/opt/yourpart/frontend/dist" ]; then
|
||||
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
|
||||
echo "Erstelle Backup von altem Frontend nach /opt/yourpart/frontend/dist.backup.$TIMESTAMP"
|
||||
sudo mv /opt/yourpart/frontend/dist /opt/yourpart/frontend/dist.backup.$TIMESTAMP || true
|
||||
fi
|
||||
|
||||
# 8. Zielverzeichnis neu erstellen
|
||||
echo "Erstelle Zielverzeichnis neu..."
|
||||
|
||||
@@ -697,9 +697,13 @@ export default {
|
||||
return [{ ...item, learning, reference }];
|
||||
},
|
||||
normalizePool(items = []) {
|
||||
try {
|
||||
const inputLen = Array.isArray(items) ? items.length : 0;
|
||||
const seen = new Set();
|
||||
return (Array.isArray(items) ? items : [])
|
||||
.flatMap((item, index) => this.expandPoolItemAlternatives(item).map((candidate, altIndex) => ({ candidate, index, altIndex })))
|
||||
const expanded = (Array.isArray(items) ? items : [])
|
||||
.flatMap((item, index) => this.expandPoolItemAlternatives(item).map((candidate, altIndex) => ({ candidate, index, altIndex })));
|
||||
|
||||
const mapped = expanded
|
||||
.map(({ candidate, index, altIndex }) => {
|
||||
const learning = String(candidate?.learning || '').trim();
|
||||
const reference = String(candidate?.reference || '').trim();
|
||||
@@ -713,8 +717,15 @@ export default {
|
||||
learning,
|
||||
reference
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
});
|
||||
|
||||
const result = mapped.filter(Boolean);
|
||||
try { console.debug('[VocabPracticeDialog] normalizePool', { inputLen, outLen: result.length, sample: result.slice(0,5) }); } catch (_) {}
|
||||
return result;
|
||||
} catch (e) {
|
||||
console.warn('[VocabPracticeDialog] normalizePool failed', e);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
resetQuestion() {
|
||||
this.current = null;
|
||||
|
||||
Reference in New Issue
Block a user