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

fix: Use relative paths to dav root #2417

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion css/viewer-main.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/* extracted by css-entry-points-plugin */
@import './main-DbamWgYd.chunk.css';
@import './main-DduclpYy.chunk.css';
8 changes: 3 additions & 5 deletions js/viewer-main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27225,7 +27225,8 @@ function pushToHistory({ fileid }) {
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
const client = davGetClient();
const davRemote = davGetRemoteURL();
const client = davGetClient(`${davRemote}${davRootPath}`);
/*! third party licenses: js/vendor.LICENSE.txt */
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
Expand Down Expand Up @@ -28224,9 +28225,6 @@ const _sfc_main$D = {
* @param {string|null} overrideHandlerId the ID of the handler with which to view the files, if any
*/
async openFile(path, overrideHandlerId = null) {
if (!path.startsWith(davRootPath)) {
path = `${davRootPath}${path}`;
}
await this.beforeOpen();
this.cancelRequestFile();
if (this.isSameFile(null, path)) {
Expand Down Expand Up @@ -28716,7 +28714,7 @@ var __component__$D = /* @__PURE__ */ normalizeComponent$1(
_sfc_staticRenderFns$D,
false,
null,
"9bc9aec6"
"e16cf4dc"
);
const ViewerComponent = __component__$D.exports;
function setAsyncState(vm, stateObject, state) {
Expand Down
2 changes: 1 addition & 1 deletion js/viewer-main.mjs.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/services/WebdavClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

import { davGetClient } from '@nextcloud/files'
import { davGetClient, davRootPath, davGetRemoteURL } from '@nextcloud/files'

export const client = davGetClient()
const davRemote = davGetRemoteURL()

export const client = davGetClient(`${davRemote}${davRootPath}`)
3 changes: 0 additions & 3 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,6 @@ export default {
* @param {string|null} overrideHandlerId the ID of the handler with which to view the files, if any
*/
async openFile(path, overrideHandlerId = null) {
if (!path.startsWith(davRootPath)) {
path = `${davRootPath}${path}`
}
await this.beforeOpen()

// cancel any previous request
Expand Down
Loading