Skip to content

Commit

Permalink
Merge pull request #7 from upryzing/feat/desktop
Browse files Browse the repository at this point in the history
Make `packages/desktop` compilable (and better)
  • Loading branch information
tulpenkiste authored Dec 18, 2024
2 parents 0373cde + d686ee8 commit 8de0d0a
Show file tree
Hide file tree
Showing 29 changed files with 12,564 additions and 10,394 deletions.
12 changes: 9 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"editor.formatOnSave": true,
"files.exclude": {
"**/node_modules": true,
"**/pnpm-lock.yaml": true,
Expand All @@ -9,9 +8,16 @@
"source.fixAll": "explicit"
},
// follow the style guidlines in `GUIDELINES.md`
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"editor.formatOnSave": true,
// `GUIDELINES.md` only really applies to JS/HTML. Using that in Rust kinda looks ugly.
"[rust]": {
"editor.tabSize": 4,
"editor.insertSpaces": false,
"editor.detectIndentation": false
},
// tell `rust-analyzer` where the Tauri project is
"rust-analyzer.linkedProjects": [
"./packages/desktop/src-tauri/Cargo.toml"
Expand Down
6 changes: 5 additions & 1 deletion packages/client/components/state/stores/Draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ export class Draft extends AbstractStore<"draft", TypeDraft> {
const body = new FormData();
const { file } = this.getFile(fileId);
body.set("file", file);
const token = this.state.auth.getSession()?.token ?? "";

// We have to use XMLHttpRequest because modern fetch duplex streams require QUIC or HTTP/2
const xhr = new XMLHttpRequest();
Expand All @@ -323,8 +324,11 @@ export class Draft extends AbstractStore<"draft", TypeDraft> {
xhr.open(
"POST",
`${client.configuration!.features.autumn.url}/attachments`,
true
true,
);

xhr.setRequestHeader("X-Session-Token", token);

xhr.send(body);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"tauri": "tauri"
},
"devDependencies": {
"@tauri-apps/cli": "^1.6.0"
"@tauri-apps/cli": "^2.1.0"
}
}
4 changes: 3 additions & 1 deletion packages/desktop/src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Generated by Cargo, will have compiled files and executables
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/schemas
Loading

0 comments on commit 8de0d0a

Please sign in to comment.