Skip to content

Commit

Permalink
WIP app permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolabosco87 committed Apr 16, 2023
1 parent c0f0f18 commit 730ac4f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 146 deletions.
141 changes: 1 addition & 140 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tauri-build = { version = "1.2", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2", features = ["api-all", "system-tray", "updater"] }
tauri = { version = "1.2", features = ["app-all", "fs-exists", "fs-read-file", "fs-write-file", "path-all", "system-tray", "updater", "window-close", "window-create", "window-hide", "window-minimize", "window-set-position", "window-show"] }

[features]
# by default Tauri runs in production mode
Expand Down
19 changes: 17 additions & 2 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,25 @@
},
"tauri": {
"allowlist": {
"all": true,
"app": {
"all": true
},
"fs": {
"all": true,
"readFile": true,
"writeFile": true,
"exists": true,
"scope": ["$HOME/.quicktracker/*", "$HOME/.quicktracker", "$HOME/*"]
},
"path": {
"all": true
},
"window": {
"create": true,
"hide": true,
"close": true,
"show": true,
"setPosition": true,
"minimize": true
}
},
"bundle": {
Expand Down
9 changes: 6 additions & 3 deletions src/hooks/useListenForNewTrackEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ export type EventAddTrackPlayload = {
export const useListenForNewTrackEvent = () => {
useEffect(() => {
const addListener = async () => {
if (listener) {
listener();
}

console.log("Add listener");
listener = await listen<EventAddTrackPlayload>("addTrack", (event) => {
addTrack(event.payload.track, event.payload.frequency);
});
};

if (!listener) {
addListener();
}
addListener();

return () => {
if (listener) {
Expand Down

0 comments on commit 730ac4f

Please sign in to comment.