mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
fix: show dynamic app version everywhere in UI
- Add get-app-version IPC handler in main.js (returns app.getVersion()) - Expose electronAPI.getAppVersion() in preload.js - index.html: replace hardcoded v4.2.0 span with dynamic population from getAppVersion() in DOMContentLoaded - welcome.js: accept appVersion param instead of hardcoded 4.1.0 - renderer.js: pass live version to createWelcomeContent() - main.js about screen: use app.getVersion() instead of hardcoded 4.1.0 - Update stale @version 4.1.0 JSDoc comments to 4.3.0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+10
-3
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* MarkdownConverter Renderer Process
|
||||
* @version 4.1.0
|
||||
* @version 4.3.0
|
||||
*/
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
@@ -1442,11 +1442,17 @@ class TabManager {
|
||||
let tabManager;
|
||||
let replPanel;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
tabManager = new TabManager();
|
||||
const ReplPanel = getReplPanel();
|
||||
replPanel = new ReplPanel();
|
||||
|
||||
// Populate app version from main process
|
||||
window.electronAPI.getAppVersion().then((version) => {
|
||||
const el = document.getElementById('app-version-display');
|
||||
if (el) el.textContent = `v${version}`;
|
||||
});
|
||||
|
||||
// Initialize ModalManager for all dialogs
|
||||
const findModal = new ModalManager('#find-dialog');
|
||||
const exportModal = new ModalManager('#export-dialog');
|
||||
@@ -1613,7 +1619,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
// Set welcome content in the first tab's preview
|
||||
const recentFiles = JSON.parse(localStorage.getItem('recentFiles') || '[]');
|
||||
const welcomeHtml = getCreateWelcomeContent()(recentFiles);
|
||||
const appVersion = await window.electronAPI.getAppVersion().catch(() => '');
|
||||
const welcomeHtml = getCreateWelcomeContent()(recentFiles, appVersion);
|
||||
|
||||
const tab = tabManager.tabs.get(tabManager.activeTabId);
|
||||
if (tab) {
|
||||
|
||||
Reference in New Issue
Block a user