Merge branch 'main' into issue/settings

This commit is contained in:
PandaDEV 2025-01-10 22:20:44 +10:00 committed by GitHub
commit dde27b37a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 50 additions and 33 deletions

View file

@ -56,11 +56,11 @@ jobs:
save-if: "true" save-if: "true"
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: ~/.bun path: ~/.pnpm-store
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-bun- ${{ runner.os }}-pnpm-
- run: curl -fsSL https://bun.sh/install | bash && bun install - run: npm install -g pnpm && pnpm install
- name: Import Apple Developer Certificate - name: Import Apple Developer Certificate
env: env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
@ -143,11 +143,11 @@ jobs:
save-if: "true" save-if: "true"
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: ~/.bun path: ~/.pnpm-store
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-bun- ${{ runner.os }}-pnpm-
- run: curl -fsSL https://bun.sh/install | bash && bun install - run: npm install -g pnpm && pnpm install
- uses: tauri-apps/tauri-action@v0 - uses: tauri-apps/tauri-action@v0
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -199,16 +199,16 @@ jobs:
save-if: "true" save-if: "true"
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: ~/.bun path: ~/.pnpm-store
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-bun- ${{ runner.os }}-pnpm-
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt update sudo apt update
sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
- run: curl -fsSL https://bun.sh/install | bash && bun install - run: npm install -g pnpm && pnpm install
- uses: tauri-apps/tauri-action@v0 - uses: tauri-apps/tauri-action@v0
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -57,11 +57,11 @@ jobs:
save-if: "true" save-if: "true"
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: ~/.bun path: ~/.pnpm-store
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-bun- ${{ runner.os }}-pnpm-
- run: curl -fsSL https://bun.sh/install | bash && bun install - run: npm install -g pnpm && pnpm install
- name: Import Apple Developer Certificate - name: Import Apple Developer Certificate
env: env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
@ -125,11 +125,11 @@ jobs:
save-if: "true" save-if: "true"
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: ~/.bun path: ~/.pnpm-store
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-bun- ${{ runner.os }}-pnpm-
- run: curl -fsSL https://bun.sh/install | bash && bun install - run: npm install -g pnpm && pnpm install
- uses: tauri-apps/tauri-action@v0 - uses: tauri-apps/tauri-action@v0
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -189,16 +189,16 @@ jobs:
save-if: "true" save-if: "true"
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: ~/.bun path: ~/.pnpm-store
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-bun- ${{ runner.os }}-pnpm-
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt update sudo apt update
sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
- run: curl -fsSL https://bun.sh/install | bash && bun install - run: npm install -g pnpm && pnpm install
- name: Generate Changelog - name: Generate Changelog
id: changelog id: changelog
run: | run: |

View file

@ -2,7 +2,7 @@ use tauri::{ async_runtime, AppHandle };
use tauri_plugin_dialog::{ DialogExt, MessageDialogButtons, MessageDialogKind }; use tauri_plugin_dialog::{ DialogExt, MessageDialogButtons, MessageDialogKind };
use tauri_plugin_updater::UpdaterExt; use tauri_plugin_updater::UpdaterExt;
pub async fn check_for_updates(app: AppHandle) { pub async fn check_for_updates(app: AppHandle, prompted: bool) {
println!("Checking for updates..."); println!("Checking for updates...");
let updater = app.updater().unwrap(); let updater = app.updater().unwrap();
@ -18,6 +18,10 @@ pub async fn check_for_updates(app: AppHandle) {
"Would you like to install it now?", "Would you like to install it now?",
]); ]);
let window = app.get_webview_window("main").unwrap();
window.show().unwrap();
window.set_focus().unwrap();
app.dialog() app.dialog()
.message(msg) .message(msg)
.title("Qopy Update Available") .title("Qopy Update Available")
@ -69,9 +73,22 @@ pub async fn check_for_updates(app: AppHandle) {
}); });
}); });
} }
Ok(None) => println!("No updates available."), Ok(None) => {
println!("No updates available.");
}
Err(e) => { Err(e) => {
println!("Failed to check for updates: {:?}", e); if prompted {
let window = app.get_webview_window("main").unwrap();
window.show().unwrap();
window.set_focus().unwrap();
app.dialog()
.message("No updates available.")
.title("Qopy Update Check")
.show(|_| {});
}
println!("No updates available. {}", e.to_string());
} }
} }
} }

View file

@ -99,7 +99,7 @@ fn main() {
let _ = app.track_event("app_started", None); let _ = app.track_event("app_started", None);
tauri::async_runtime::spawn(async move { tauri::async_runtime::spawn(async move {
api::updater::check_for_updates(app_handle).await; api::updater::check_for_updates(app_handle, false).await;
}); });
Ok(()) Ok(())

View file

@ -5,8 +5,8 @@
"build": { "build": {
"frontendDist": "../dist", "frontendDist": "../dist",
"devUrl": "http://localhost:3000", "devUrl": "http://localhost:3000",
"beforeDevCommand": "bun nuxt dev", "beforeDevCommand": "pnpm nuxt dev",
"beforeBuildCommand": "bun nuxt generate" "beforeBuildCommand": "pnpm nuxt generate"
}, },
"app": { "app": {
"windows": [ "windows": [