Skip to content

Commit 820d7eb

Browse files
committed
Merge branch 'main' into FranksDev
2 parents da86f38 + 1feaafb commit 820d7eb

3 files changed

Lines changed: 35 additions & 9 deletions

File tree

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,18 @@ The XRP software platform is an integrated development environment where you can
5656
npm install
5757
```
5858

59-
3. **Start the development server**
59+
3. **Create the environment file**
60+
61+
Create a `.env` file in the project root:
62+
```
63+
GOOGLE_CHATAPI_PROXY_TARGET=http://localhost:8000
64+
GOOGLE_AUTH_URL=
65+
```
66+
67+
- `GOOGLE_CHATAPI_PROXY_TARGET` — URL of the AI chat API backend (proxied under `/api`)
68+
- `GOOGLE_AUTH_URL` — Base URL of the Google Auth backend (used to fetch the OAuth client ID)
69+
70+
4. **Start the development server**
6071
```bash
6172
npm run dev
6273
```

src/managers/commandstoxrpmgr.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,24 @@ export class CommandToXRPMgr {
423423
};
424424
for (const dir of wipeDirs) {
425425
if (urls.some(([dest]) => destStartsWithDir(dest, dir))) {
426-
await this.deleteFileOrDir(dir);
426+
// Skip the per-delete FS-tree walk; getOnBoardFSTree() runs once at the end.
427+
await this.deleteFileOrDir(dir, false);
427428
}
428429
}
429430

431+
// Build each unique destination directory once instead of once per file.
432+
const uniqueDirs = new Set<string>();
433+
for (const [deviceDest] of urls) {
434+
uniqueDirs.add(deviceDest.substring(0, deviceDest.lastIndexOf('/')));
435+
}
436+
for (const dir of uniqueDirs) {
437+
await this.buildPath(dir);
438+
}
439+
430440
for (let i = 0; i < urls.length; i++) {
431441
const [deviceDest, sourceRel] = urls[i];
432442
const fetchUrl = resolveSourceUrl(sourceRel) + '?version=' + cacheToken;
433-
await this.uploadFile(deviceDest, await this.downloadFile(fetchUrl));
443+
await this.uploadFile(deviceDest, await this.downloadFile(fetchUrl), false, false);
434444
emitProgress(cur_percent);
435445
cur_percent += percent_per;
436446
}
@@ -764,13 +774,15 @@ export class CommandToXRPMgr {
764774
}
765775

766776

767-
async uploadFile(filePath: string, fileContents: string | Uint8Array, usePercent: boolean = false) {
777+
async uploadFile(filePath: string, fileContents: string | Uint8Array, usePercent: boolean = false, ensurePath: boolean = true) {
768778
if (this.BUSY == true) {
769779
return true;
770780
}
771781

772-
const pathToFile = filePath.substring(0, filePath.lastIndexOf('/'));
773-
await this.buildPath(pathToFile);
782+
if (ensurePath) {
783+
const pathToFile = filePath.substring(0, filePath.lastIndexOf('/'));
784+
await this.buildPath(pathToFile);
785+
}
774786

775787
this.BUSY = true;
776788
if (usePercent)
@@ -962,7 +974,7 @@ export class CommandToXRPMgr {
962974

963975

964976
// Given a path, delete it on XRP
965-
async deleteFileOrDir(path: string) {
977+
async deleteFileOrDir(path: string, refreshTree: boolean = true) {
966978
if (path != undefined) {
967979
if (this.BUSY == true) {
968980
return;
@@ -996,7 +1008,9 @@ export class CommandToXRPMgr {
9961008
this.BUSY = false;
9971009

9981010
// Make sure to update the filesystem after modifying it
999-
await this.getOnBoardFSTree();
1011+
if (refreshTree) {
1012+
await this.getOnBoardFSTree();
1013+
}
10001014
//window.setPercent?.(100); TODO:
10011015
//window.resetPercentDelay?.();
10021016
}

tailwind.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export default {
88
'./index.html',
99
'./src/**/*.{js,ts,jsx,tsx}',
1010
'./node_modules/flowbite-react/**/*.{js,ts,jsx,tsx}',
11-
".flowbite-react/class-list.json"
11+
".flowbite-react/class-list.json",
12+
".flowbite-react\\class-list.json"
1213
],
1314
theme: {
1415
colors: {

0 commit comments

Comments
 (0)