Skip to content
Open
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
16 changes: 8 additions & 8 deletions apps/files_sharing/src/public-nickname-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ import logger from './services/logger.ts'

const storage = getBuilder('files_sharing').build()

// Setup file-request nickname header for the uploader
/**
* Setup file-request nickname header for the uploader
*
* @param nickname
* @param nickname - The nickname to set in the header
*/
function registerFileRequestHeader(nickname: string) {
const uploader = getUploader()
uploader.setCustomHeader('X-NC-Nickname', encodeURIComponent(nickname))
logger.debug('Nickname header registered for uploader', { headers: uploader.customHeaders })
}

// Callback when a nickname was chosen
/**
* Callback when a nickname was chosen
*
* @param guest
* @param guest - The guest user with the new nickname
*/
function onUserInfoChanged(guest: NextcloudUser) {
logger.debug('User info changed', { guest })
Expand All @@ -57,20 +57,20 @@ window.addEventListener('DOMContentLoaded', () => {

const options = {
nickname,
notice: t('files_sharing', 'To upload files to {folder}, you need to provide your name first.', { folder }),
notice: t('files_sharing', 'To upload files to {folder}, you need to provide your name first.', { folder }, { escape: false }),
subtitle: undefined as string | undefined,
title: t('files_sharing', 'Upload files to {folder}', { folder }),
title: t('files_sharing', 'Upload files to {folder}', { folder }, { escape: false }),
}

// If the guest already has a nickname, we just make them double check
if (nickname) {
options.notice = t('files_sharing', 'Please confirm your name to upload files to {folder}', { folder })
options.notice = t('files_sharing', 'Please confirm your name to upload files to {folder}', { folder }, { escape: false })
}

// If the account owner set their name as public,
// we show it in the subtitle
if (owner) {
options.subtitle = t('files_sharing', '{ownerDisplayName} shared a folder with you.', { ownerDisplayName })
options.subtitle = t('files_sharing', '{ownerDisplayName} shared a folder with you.', { ownerDisplayName }, { escape: false })
}

// If this is a file request, then we need a nickname
Expand Down
4 changes: 2 additions & 2 deletions dist/files_sharing-public-nickname-handler.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-public-nickname-handler.js.map

Large diffs are not rendered by default.

Loading