Skip to content

Commit

Permalink
Fix #9
Browse files Browse the repository at this point in the history
  • Loading branch information
blopker committed Feb 17, 2025
1 parent 597432e commit 6681b7e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Unreleased

# 2.0.12

- Fix #9: 'Open with...' on file now works when Alic is closed.

# 2.0.11

- Update a few dependencies
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schema.tauri.app/config/2",
"mainBinaryName": "Alic",
"productName": "Alic Image Compressor",
"version": "2.0.11",
"version": "2.0.12",
"identifier": "io.kbl.alic",
"build": {
"beforeDevCommand": "bun run dev",
Expand Down
11 changes: 7 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { onOpenUrl } from "@tauri-apps/plugin-deep-link";
import { getCurrent, onOpenUrl } from "@tauri-apps/plugin-deep-link";
import BottomBar from "./BottomBar";
import Dropper from "./Dropper";
import Table from "./Table";
Expand All @@ -16,13 +16,16 @@ badFileListener((path) => {
});
});

onOpenUrl((urls) => {
console.log("deep link:", urls);
// Initialize deep link handling
handleDeepLink((await getCurrent()) ?? []);
onOpenUrl(handleDeepLink);
function handleDeepLink(urls: string[]) {
// [Log] deep link: – ["file:///Users/myuser/Downloads/file.jpg"]
// console.log("deep link:", urls);
for (const url of urls) {
addFile(decodeURI(url.replace("file://", "")));
}
});
}

function App() {
return (
Expand Down

0 comments on commit 6681b7e

Please sign in to comment.