chore(files): migrate davUtils to TS
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>pull/48625/head
parent
7723faf51a
commit
2696715d90
@ -1,14 +0,0 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
|
||||
export const isPublic = function() {
|
||||
return !getCurrentUser()
|
||||
}
|
||||
|
||||
export const getToken = function() {
|
||||
return document.getElementById('sharingToken') && document.getElementById('sharingToken').value
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
Loading…
Reference in New Issue