update/improve-uix #2

Merged
jchomaz merged 12 commits from update/improve-uix into main 2026-02-03 19:54:50 +01:00
Showing only changes of commit 0244854ddb - Show all commits

View File

@@ -59,7 +59,7 @@
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
import { ref, reactive, onMounted, onUnmounted } from 'vue';
import mqtt from 'mqtt';
import config from '@/config.js'; // Ensure correct path
@@ -72,7 +72,11 @@
Green: { Total: 0, Round: 0 },
});
const client = mqtt.connect(config.mqttBrokerUrl);
// const client = mqtt.connect(config.mqttBrokerUrl);
let client = null;
onMounted(() => {
client = mqtt.connect(config.mqttBrokerUrl);
client.on('connect', () => {
console.log('CardButtonScore: Connected to MQTT broker at', config.mqttBrokerUrl);
@@ -101,6 +105,13 @@
}
}
});
});
onUnmounted(() => {
if (client) {
client.end();
}
});
function toggleCardSize() {
isCardReduced.value = !isCardReduced.value;