Skip to content

Commit 10bbd9a

Browse files
committed
ui: hide send to device on remote
1 parent 74dbad3 commit 10bbd9a

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

src-tauri/src/http.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use crate::{
1414

1515
const PORT: u16 = 61440;
1616
const HOST: &str = "0.0.0.0";
17-
//const URL: &str = "https://citadel-backend.fly.dev";
18-
const URL: &str = "http://localhost:61440";
17+
const URL: &str = "https://citadel-backend.fly.dev";
18+
// const URL: &str = "http://localhost:61440";
1919

2020
struct AppState {
2121
library_path: String,
@@ -90,7 +90,6 @@ async fn list_books(data: web::Data<AppState>) -> impl Responder {
9090
x.cover_image = Some(LocalOrRemoteUrl {
9191
kind: LocalOrRemote::Remote,
9292
url: format!("{}/covers/{}.jpg", URL, x.id),
93-
// url: format!("http://localhost:61440/covers/{}.jpg", x.id),
9493
local_path: None,
9594
});
9695
x.file_list = x

src-tauri/src/libs/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ pub fn path_to_asset_url(file_path: &Path) -> String {
1010
} else {
1111
format!("{}://localhost/{}", protocol, path)
1212
}
13-
}
13+
}

src-tauri/tauri.conf.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
"readDir": true,
2929
"readFile": true,
3030
"writeFile": true,
31-
"scope": [
32-
"$APPCONFIG",
33-
"$APPCONFIG/*"
34-
]
31+
"scope": ["$APPCONFIG", "$APPCONFIG/*"]
3532
},
3633
"protocol": {
3734
"asset": true,
@@ -90,4 +87,4 @@
9087
}
9188
]
9289
}
93-
}
90+
}

src/components/atoms/BookAsCover.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@
6161
<Button on:click={() => handleDownload(book)}>Download</Button>
6262
{/if}
6363
<Button disabled>Info</Button>
64-
<Button on:click={() => (isSendingToDevice = true)}>Send</Button>
64+
{#if window.__TAURI__}
65+
<Button on:click={() => (isSendingToDevice = true)}>Send</Button>
66+
{/if}
6567
<Button disabled>Convert</Button>
6668
<hr />
6769
<Button disabled>Delete</Button>

src/routes/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@
128128
await initLibrary({
129129
libraryType: "calibre",
130130
connectionType: "remote",
131-
url: "http://localhost:61440",
132-
// url: "https://citadel-backend.fly.dev",
131+
// url: "http://localhost:61440",
132+
url: "https://citadel-backend.fly.dev",
133133
});
134134
}
135135
await waitForLibrary();

0 commit comments

Comments
 (0)