Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
chore(files): migrate davUtils to TS
Signed-off-by: Grigorii K. Shartsev <[email protected]>
  • Loading branch information
ShGKme authored and backportbot[bot] committed Oct 25, 2024
commit 2f7eeab191a4b77bb4497a1075fec232d3d688d4
2 changes: 1 addition & 1 deletion apps/files/src/components/TemplatePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<script>
import { encodePath } from '@nextcloud/paths'
import { generateUrl } from '@nextcloud/router'
import { getToken, isPublic } from '../utils/davUtils.js'
import { getToken, isPublic } from '../utils/davUtils.ts'

// preview width generation
const previewWidth = 256
Expand Down
14 changes: 0 additions & 14 deletions apps/files/src/utils/davUtils.js

This file was deleted.

23 changes: 23 additions & 0 deletions apps/files/src/utils/davUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { getCurrentUser } from '@nextcloud/auth'

/**
* Check whether this is a public share
* @return {boolean} Whether this is a public share
*/
export function isPublic() {
return !getCurrentUser()
}

/**
* Get the sharing token
* @return {string|null} The sharing token
*/
export function getToken() {
const tokenElement = document.getElementById('sharingToken') as (HTMLInputElement | null)
return tokenElement?.value
}