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/components/extensions-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default function ExtensionsView({
</div>
</div>

<div className="flex gap-2 p-4 ">
<div className="flex gap-2 p-4">
<Button
onClick={() => setExtensionsActiveTab("all")}
variant="ghost"
Expand Down
14 changes: 13 additions & 1 deletion src/components/window/welcome-screen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { AlertCircle, Download, Folder } from "lucide-react";
import { useEffect, useState } from "react";
import Button from "@/components/ui/button";
import { useUpdater } from "@/settings/hooks/use-updater";
import { fetchRawAppVersion } from "@/utils/app-utils";
import { cn } from "@/utils/cn";

interface RecentFolder {
Expand All @@ -20,6 +22,7 @@ const WelcomeScreen = ({
recentFolders = [],
onOpenRecentFolder,
}: WelcomeScreenProps) => {
const [appVersion, setAppVersion] = useState<string>("...");
const {
available,
checking,
Expand All @@ -31,6 +34,15 @@ const WelcomeScreen = ({
dismissUpdate,
} = useUpdater(true);

useEffect(() => {
const loadVersion = async () => {
const version = await fetchRawAppVersion();
setAppVersion(version);
};

loadVersion();
}, []);

const handleRecentFolderClick = (path: string) => {
if (onOpenRecentFolder) {
onOpenRecentFolder(path);
Expand All @@ -53,7 +65,7 @@ const WelcomeScreen = ({
<img src="/logo.svg" alt="athas industries" className={cn("h-12")} draggable="false" />
</div>
<div className={cn("flex items-center gap-2")}>
<p className={cn("paper-text-light font-mono font-normal text-xs")}>v0.1.0</p>
<p className={cn("paper-text-light font-mono font-normal text-xs")}>v{appVersion}</p>
{checking && (
<div className={cn("paper-text-light text-xs")} title="Checking for updates...">
Expand Down
16 changes: 16 additions & 0 deletions src/utils/app-utils.ts
Comment thread
abue-ammar marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { getVersion } from "@tauri-apps/api/app";

/**
* Fetches the raw application version from Tauri API without 'v' prefix
* @returns Promise<string> - Raw application version (e.g., "1.0.0")
*/
export const fetchRawAppVersion = async (): Promise<string> => {
try {
const version = await getVersion();
return version;
} catch (error) {
console.error("Failed to fetch app version:", error);
// Return default version if fetching fails
return "0.1.0";
}
};
Loading