From 5351e3ea5740427e02b19bbfae9613141ec6fc79 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 29 Jan 2026 09:23:24 +0100 Subject: [PATCH] Refactor NobilityView: Remove debug logs and improve conditional rendering for advance section. Add cooldown message styling for better user feedback when advancement is not possible. --- frontend/src/views/falukant/NobilityView.vue | 48 +++++--------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/frontend/src/views/falukant/NobilityView.vue b/frontend/src/views/falukant/NobilityView.vue index b7f7303..a83f00c 100644 --- a/frontend/src/views/falukant/NobilityView.vue +++ b/frontend/src/views/falukant/NobilityView.vue @@ -23,30 +23,21 @@ {{ $t('falukant.nobility.nextTitle') }}: {{ $t(`falukant.titles.${gender}.${next.labelTr}`) }}

-

- {{ $t('falukant.nobility.cooldown', { date: formatDate(nextAdvanceAt) }) }} -

- -
- Debug: canAdvance={{ canAdvance }}, isAdvancing={{ isAdvancing }}, next={{ next ? 'exists' : 'null' }}, nextAdvanceAt={{ nextAdvanceAt }} -
-
- Debug: canAdvance = false (next: {{ next ? 'exists' : 'null' }}, nextAdvanceAt: {{ nextAdvanceAt }}) -
+

+ {{ $t('falukant.nobility.cooldown', { date: formatDate(nextAdvanceAt) }) }} +

Fehler: Keine nächste Titel-Information verfügbar. Bitte Seite neu laden.

-
- Debug: next={{ next }}, next.labelTr={{ next ? next.labelTr : 'N/A' }} -
@@ -117,41 +108,19 @@ }, async loadNobility() { try { - console.log('[NobilityView] Loading nobility data...'); const { data } = await apiClient.get('/api/falukant/nobility'); - console.log('[NobilityView] Received data:', data); this.current = data.current || { labelTr: '', requirements: [], charactersWithNobleTitle: [] }; this.next = data.next || { labelTr: '', requirements: [] }; this.nextAdvanceAt = data.nextAdvanceAt || null; - console.log('[NobilityView] Updated state:', { - current: this.current, - next: this.next, - nextAdvanceAt: this.nextAdvanceAt, - canAdvance: this.canAdvance - }); } catch (err) { - console.error('[NobilityView] Error loading nobility:', err); + console.error('Error loading nobility:', err); } }, async applyAdvance() { - console.log('[NobilityView] applyAdvance called', { - canAdvance: this.canAdvance, - isAdvancing: this.isAdvancing, - next: this.next, - nextAdvanceAt: this.nextAdvanceAt - }); - if (!this.canAdvance || this.isAdvancing) { - console.log('[NobilityView] applyAdvance blocked:', { - canAdvance: this.canAdvance, - isAdvancing: this.isAdvancing - }); - return; - } + if (!this.canAdvance || this.isAdvancing) return; this.isAdvancing = true; try { - console.log('[NobilityView] Sending POST request to /api/falukant/nobility'); await apiClient.post('/api/falukant/nobility'); - console.log('[NobilityView] POST request successful, reloading nobility data'); await this.loadNobility(); } catch (err) { console.error('Error advancing nobility:', err); @@ -188,4 +157,9 @@ list-style: disc inside; margin-bottom: 1rem; } + .cooldown-message { + color: #666; + font-style: italic; + margin-top: 1rem; + } \ No newline at end of file