Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oratiotext"
version = "1.0.1"
version = "1.0.2"
description = "A cross-platform desktop application for converting speech to text using Whisper"
authors = ["kylethedeveloper"]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-config-schema/schema.json",
"productName": "OratioText",
"version": "1.0.1",
"version": "1.0.2",
"identifier": "com.oratiotext.app",
"build": {
"frontendDist": "../src"
Expand Down
28 changes: 24 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,33 @@ <h1>OratioText</h1>

<main class="app-main hidden" id="page-about">
<section class="card about-section">
<p id="app-version" style="color: var(--color-text-muted); font-size: 0.9em; margin-bottom: 16px;">Loading
version...</p>
<div
style="display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px;">
<p id="app-version" style="color: var(--color-text-muted); font-size: 0.9em; margin: 0;">Loading version...
</p>
<div style="display: flex; gap: 8px; align-items: center;">
<button id="check-update-btn" class="btn btn-secondary btn-sm"
style="padding: 2px 8px; font-size: 0.75em;">Check for updates</button>
<a id="update-status" href="https://github.com/kylethedeveloper/OratioText/releases" target="_blank"
class="hidden" style="font-size: 0.8em; text-decoration: none; font-weight: 600;"></a>
</div>
</div>
<p style="margin-bottom: 24px;">OratioText is a speech to text application that runs entirely on your local
machine, ensuring
full privacy.<br />It uses the whisper.cpp models under the hood.</p>
<a href="https://github.com/kylethedeveloper/OratioText" target="_blank" class="github-link"
style="color: var(--color-primary); text-decoration: none; font-weight: 600;">GitHub Repository</a>
<div style="margin-bottom: 16px;">
<script type="text/javascript" src="https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js"
data-name="bmc-button" data-slug="kylethedev" data-color="#cdfd84" data-emoji="☕" data-font="Bree"
data-text="Support me!" data-outline-color="#000000" data-font-color="#000000"
data-coffee-color="#FFDD00"></script>
</div>
<div style="display: flex; gap: 16px; align-items: center;">
<a href="https://github.com/kylethedeveloper/OratioText" target="_blank" class="github-link"
style="color: var(--color-primary); text-decoration: none; font-weight: 600;">GitHub Repository</a>
<span style="color: var(--color-border);">|</span>
<a href="https://github.com/kylethedeveloper/OratioText/issues/new" target="_blank" class="github-link"
style="color: var(--color-primary); text-decoration: none; font-weight: 600;">Report an Issue</a>
</div>
</section>
</main>
</div>
Expand Down
59 changes: 59 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,62 @@ function toggleTheme() {
themeToggle.addEventListener("click", toggleTheme);
initTheme();

// ---- Update Check ---------------------------------------------------------

const checkUpdateBtn = document.getElementById("check-update-btn");
const updateStatus = document.getElementById("update-status");

if (checkUpdateBtn) {
checkUpdateBtn.addEventListener("click", checkForUpdates);
}

async function checkForUpdates() {
checkUpdateBtn.disabled = true;
checkUpdateBtn.textContent = "Checking...";
updateStatus.classList.add("hidden");

try {
const response = await fetch("https://api.github.com/repos/kylethedeveloper/OratioText/releases/latest");
if (!response.ok) throw new Error("Failed to check for updates");
const data = await response.json();

// Tag names typically have a 'v' prefix, e.g. 'v1.0.1'. Clean it up easily:
const latestVersion = data.tag_name.replace(/^v/, '');
const currentVersion = await invoke("get_app_version");

const isNewer = compareVersions(latestVersion, currentVersion) > 0;

updateStatus.classList.remove("hidden");
if (isNewer) {
updateStatus.textContent = "⚠ Newer version available!";
updateStatus.style.color = "var(--color-warning)";
updateStatus.style.pointerEvents = "auto";
updateStatus.style.cursor = "pointer";
} else {
updateStatus.textContent = "☑ App up to date!";
updateStatus.style.color = "var(--color-success)";
updateStatus.style.pointerEvents = "none";
updateStatus.style.cursor = "default";
}
} catch (err) {
console.error("Update check failed", err);
updateStatus.textContent = "Failed to check update.";
updateStatus.style.color = "var(--color-error)";
updateStatus.classList.remove("hidden");
} finally {
checkUpdateBtn.disabled = false;
checkUpdateBtn.textContent = "Check for updates";
}
}

function compareVersions(v1, v2) {
const parts1 = v1.split('.').map(Number);
const parts2 = v2.split('.').map(Number);
for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
const n1 = parts1[i] || 0;
const n2 = parts2[i] || 0;
if (n1 > n2) return 1;
if (n1 < n2) return -1;
}
return 0;
}
Loading