Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make packages/desktop compilable #7

Merged
merged 13 commits into from
Dec 18, 2024
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
Loading