TunnlTo / desktop-app

TunnlTo is a Windows WireGuard VPN client built for split tunnelling.
https://tunnl.to
1.31k stars 58 forks source link

Auto Update TunnlTo Settings Version Number Display on the Settings Page UI #160

Closed TheCodingCarson closed 4 months ago

TheCodingCarson commented 6 months ago

Hey so this is just an idea to make life a tiny bit easier when updating versions of TunnlTo.

Automaticlly get the Version of TunnlTo for the UI display on the settings page (src\components\containers\Settings.tsx) by adding

import { getVersion } from '@tauri-apps/api/app'
const appVersion = await getVersion();

and changing

<p className="text-xs text-gray-600 pt-2">
  TunnlTo 1.0.6
  <br />
  WireSock {wiresockInstallDetails?.version}
</p>

to

<p className="text-xs text-gray-600 pt-2">
  TunnlTo {appVersion}
  <br />
  WireSock {wiresockInstallDetails?.version}
</p>

only issue I see is you would need to fix the "Top-level await" error it will give you after by adding

build: { target: "es2022" }

to vite.config.ts

but just an idea to make it so whatever the tauri.conf.json file says for the version is what it will show on the settings page UI

brendanosborne commented 4 months ago

Thanks for this. I've implemented something similar in version 1.0.7