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
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ jobs:
rustup component add clippy
cargo clippy --all-targets --all-features -- -D warnings
- name: Run cargo deny
uses: EmbarkStudios/cargo-deny-action@v2
with:
manifest-path: ./src-tauri/Cargo.toml
working-directory: ./src-tauri
run: |
cargo install cargo-deny
cargo deny check
- name: Run tests
run: cargo test --locked --no-fail-fast
2 changes: 2 additions & 0 deletions src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"notification:default",
"os:default",
"os:allow-hostname",
"dialog:default",
"clipboard-manager:allow-write-text",
{
"identifier": "http:default",
"allow": [
Expand Down
1 change: 1 addition & 0 deletions src-tauri/deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ ignore = [
{ id = "RUSTSEC-2024-0419", reason = "Tauri v2 GTK3 dependency (unmaintained)" },
{ id = "RUSTSEC-2024-0420", reason = "Tauri v2 GTK3 dependency (unmaintained)" },
{ id = "RUSTSEC-2025-0052", reason = "Discontinued, but dark-light v2.0.0 needs it" },
{ id = "RUSTSEC-2025-0057", reason = "Tauri needs it" },
]
# If this is true, then cargo deny will use the git executable to fetch advisory database.
# If this is false, then it uses a built-in git library.
Expand Down
23 changes: 10 additions & 13 deletions src/shared/hooks/useClipboard.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { writeText } from '@tauri-apps/plugin-clipboard-manager';
import { useCallback } from 'react';

import { useI18nContext } from '../../i18n/i18n-react';
Expand All @@ -10,20 +11,16 @@ export const useClipboard = () => {

const writeToClipboard = useCallback(
async (content: string, customMessage?: string) => {
if (window.isSecureContext) {
try {
await navigator.clipboard.writeText(content);
if (customMessage) {
toaster.success(customMessage);
} else {
toaster.success(LL.common.messages.clipboard.success());
}
} catch (e) {
toaster.error(LL.common.messages.clipboard.error());
console.error(e);
try {
await writeText(content);
if (customMessage) {
toaster.success(customMessage);
} else {
toaster.success(LL.common.messages.clipboard.success());
}
} else {
toaster.warning(LL.common.messages.insecureContext());
} catch (e) {
toaster.error(LL.common.messages.clipboard.error());
console.error(e);
}
},
[LL.common.messages, toaster],
Expand Down