From f4f651296947071184776f98a3e37c71157e8ea6 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 9 Mar 2025 16:48:22 +0100 Subject: [PATCH] chore: minor stock naming improvements --- src/components/tabs/stock-list/StockActions.vue | 2 +- src/components/tabs/stock-list/StockSpecs.vue | 3 +-- src/utils/fileUtils.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/tabs/stock-list/StockActions.vue b/src/components/tabs/stock-list/StockActions.vue index 6b3ed40..3442fa1 100644 --- a/src/components/tabs/stock-list/StockActions.vue +++ b/src/components/tabs/stock-list/StockActions.vue @@ -242,7 +242,7 @@ export default defineComponent({ saveStockDataToStorage() { if (this.store.stockList.length == 0) return; - const defaultName = `${this.store.stockList[0].vehicleRef.type} ${(this.store.totalWeight / 1000).toFixed(1)}t; ${this.store.totalLength}m; vmax ${this.store.maxStockSpeed}`; + const defaultName = this.fileUtils.getCurrentStockFileName(); const entryName = prompt(this.$t('stocklist.prompt-bookmark'), defaultName); if (!entryName) return; diff --git a/src/components/tabs/stock-list/StockSpecs.vue b/src/components/tabs/stock-list/StockSpecs.vue index afdac71..938a994 100644 --- a/src/components/tabs/stock-list/StockSpecs.vue +++ b/src/components/tabs/stock-list/StockSpecs.vue @@ -10,9 +10,8 @@ {{ store.chosenStorageStockName.slice(0, 40) }} {{ store.chosenStorageStockName.length > 41 ? '...' : '' }} - | - + | diff --git a/src/utils/fileUtils.ts b/src/utils/fileUtils.ts index 6e3910c..122b37a 100644 --- a/src/utils/fileUtils.ts +++ b/src/utils/fileUtils.ts @@ -14,7 +14,7 @@ export const useFileUtils = () => { // Append real composition to the name if chosen if (currentRealComp != undefined) { - fileName += currentRealComp.stockId; + fileName += `${currentRealComp.stockId} `; } // Append default props