Skip to content

Commit 2377ef2

Browse files
committed
overlay: force proxy on pickBestItemAction/pickBestAttachmentItemAction; bump v0.1.12
1 parent 5f6e5f8 commit 2377ef2

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

.env.portainer.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Portainer stack environment (example values). Copy to `.env.portainer` for Portainer UI deployment.
22

33
# GHCR images to deploy (choose tags built by CI) — default to a pinned release tag
4-
PDF_PROXY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/pdf-proxy:v0.1.11
5-
WEB_LIBRARY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/web-library:v0.1.11
4+
PDF_PROXY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/pdf-proxy:v0.1.12
5+
WEB_LIBRARY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/web-library:v0.1.12
66

77
# Host path for Zotero WebDAV data mounted into the proxy container
88
ZOTERO_ROOT_HOST_PATH=/volume1/Reference/zotero

.env.stage.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Staging/NAS environment configuration (example values). Copy to `.env.stage` on the staging host.
22

33
# GHCR images to deploy (choose tags built by CI) — default to a pinned release tag
4-
PDF_PROXY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/pdf-proxy:v0.1.11
5-
WEB_LIBRARY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/web-library:v0.1.11
4+
PDF_PROXY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/pdf-proxy:v0.1.12
5+
WEB_LIBRARY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/web-library:v0.1.12
66

77
# Host path for Zotero WebDAV data mounted into the proxy container
88
ZOTERO_ROOT_HOST_PATH=/volume1/Reference/zotero

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Self-hosted Zotero WebUI Opensource Library + WebDAV-based PDF viewer **Avoid storage fees, keep privacy, and still enjoy a full browser-based Zotero library.
44

55
## It is PoC
6-
It(v0.1.11) is still fully not properly works, please keep on watching to be ready for production.
6+
It(v0.1.12) is still fully not properly works, please keep on watching to be ready for production.
77

88
---
99

app/web-library-overlay/src/js/actions/attachments.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,18 @@ const pickBestItemAction = itemKey => {
9090
const attachment = get(item, [Symbol.for('links'), 'attachment'], null);
9191
if(attachment) {
9292
const attachmentItemKey = getItemFromApiUrl(attachment.href);
93+
const proxyUrl = getProxyPdfUrl(state, attachmentItemKey);
94+
9395
if (Object.keys(READER_CONTENT_TYPES).includes(attachment.attachmentType)) {
94-
// "best" attachment is PDF, open in reader
96+
// "best" attachment is PDF: prefer proxy if available, else reader path
97+
if (proxyUrl) {
98+
console.log('[proxy-debug] pickBestItemAction -> proxy open', {
99+
itemKey,
100+
attachmentItemKey,
101+
proxyUrl,
102+
});
103+
return window.open(proxyUrl, '_blank');
104+
}
95105
const readerPath = makePath(state.config, {
96106
attachmentKey: attachmentItemKey,
97107
collection: current.collectionKey,
@@ -137,7 +147,7 @@ const pickBestAttachmentItemAction = attachmentItemKey => {
137147
contentType: item.contentType,
138148
proxyUrl,
139149
});
140-
return openDelayedURL(dispatch(getAttachmentUrl(attachmentItemKey)));
150+
return window.open(proxyUrl, '_blank');
141151
}
142152

143153
const readerPath = makePath(state.config, {

0 commit comments

Comments
 (0)