Bug fix
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 53s

This commit is contained in:
2026-10-11 22:38:59 +02:00
parent 1402045001
commit 1fab8ce20d
7 changed files with 32 additions and 8 deletions

View File

@@ -1,9 +1,10 @@
<script setup>
import TopSearchBar from './topbar/TopSearchBar.vue';
import { useCampaignService } from '~/services/Campaign.js';
import { SetShowContent } from '~/services/Content.js';
import { ClearWindow, CreateWindow } from '~/services/Windows';
const { Campaign } = useCampaignService();
const { Campaign, SetCampaign } = useCampaignService();
const campaignName = computed(() => Campaign.value?.name || 'Campaign');
function OpenCampaignSettings() {
@@ -11,6 +12,15 @@ function OpenCampaignSettings() {
ClearWindow({ type: 'campaign_settings' });
CreateWindow('campaign_settings', { campaign: Campaign.value });
}
function ExitCampaign() {
// Torn al menú principal: neteja la campanya (i el localStorage), amaga
// l'espai de treball i reobre el menú
ClearWindow({ type: 'campaign_settings' });
SetCampaign(null);
SetShowContent(false);
CreateWindow('main_menu');
}
</script>
<template>
@@ -28,6 +38,9 @@ function OpenCampaignSettings() {
<button class="btn-primary settings-button sound-click" type="button" @click="OpenCampaignSettings">
{{ $t('main-menu.settings') }}
</button>
<button class="btn-primary settings-button exit-button sound-click" type="button" @click="ExitCampaign">
{{ $t('main-menu.exit') }}
</button>
</div>
</div>
</template>
@@ -65,6 +78,7 @@ function OpenCampaignSettings() {
justify-content: flex-end;
flex: 1;
padding: 0 10px;
gap: 8px;
}
.settings-button {