|
8 | 8 | const { invoke } = window.__TAURI__.core; |
9 | 9 | const { open } = window.__TAURI__.dialog; |
10 | 10 |
|
| 11 | +// ===== App Version ===== |
| 12 | +let APP_VERSION = 'v0.1.0'; // Fallback hvis backend feiler |
| 13 | + |
11 | 14 | // ===== DOM Elements ===== |
12 | 15 | const elements = { |
13 | 16 | urlBar: document.getElementById('url-bar'), |
@@ -684,9 +687,9 @@ function updateFooter(path, wasConverted = false) { |
684 | 687 | if (path && path !== '__home__') { |
685 | 688 | const filename = path.split(/[\\/]/).pop(); |
686 | 689 | const conversionIndicator = wasConverted ? ' (konvertert)' : ''; |
687 | | - elements.footerInfo.textContent = `Bare v0.1.0 — ${filename}${conversionIndicator}`; |
| 690 | + elements.footerInfo.textContent = `Bare ${APP_VERSION} — ${filename}${conversionIndicator}`; |
688 | 691 | } else { |
689 | | - elements.footerInfo.textContent = 'Bare v0.1.0'; |
| 692 | + elements.footerInfo.textContent = `Bare ${APP_VERSION}`; |
690 | 693 | } |
691 | 694 | } |
692 | 695 |
|
@@ -912,6 +915,16 @@ function isInputFocused() { |
912 | 915 |
|
913 | 916 | // ===== Initialization ===== |
914 | 917 | async function init() { |
| 918 | + // Hent versjon fra backend |
| 919 | + try { |
| 920 | + const version = await invoke('get_app_version'); |
| 921 | + APP_VERSION = 'v' + version; |
| 922 | + // Oppdater footer med riktig versjon |
| 923 | + elements.footerInfo.textContent = `Bare ${APP_VERSION}`; |
| 924 | + } catch (error) { |
| 925 | + console.error('Kunne ikke hente app-versjon:', error); |
| 926 | + } |
| 927 | + |
915 | 928 | await loadSettings(); |
916 | 929 | initEventListeners(); |
917 | 930 | updateNavigationButtons(); |
|
0 commit comments