Skip to content
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
9 changes: 8 additions & 1 deletion apps/app/app/pages/p/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ const metaError = ref('')
const meta = ref<MetaResponse | null>(null)
const fragmentKey = ref<Bytes | null>(null)

// Only where there is a password, and only for pastes carrying an unlock hash: `reveal.post.ts`
// spends nothing on a wrong one, but its `isNull` legacy branch still burns a read.
const burnWarning = computed(() => [
t('read.burnWarningDescription'),
...(meta.value?.passwordProtected ? [t('read.burnWarningPassword')] : [])
].join(' '))

onMounted(async () => {
const keyParam = new URLSearchParams(window.location.hash.replace(/^#/, '')).get('key')
if (!keyParam) {
Expand Down Expand Up @@ -174,7 +181,7 @@ async function copyText() {
color="warning"
variant="subtle"
:title="t('read.burnWarningTitle')"
:description="t('read.burnWarningDescription')"
:description="burnWarning"
/>
<UAlert
v-if="revealError"
Expand Down
3 changes: 2 additions & 1 deletion apps/app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
"readsRemaining": "Reads remaining: {count}",
"passwordLabel": "This paste is password protected",
"burnWarningTitle": "Revealing consumes one read",
"burnWarningDescription": "Once revealed, this counts against the paste's read limit — even if the password turns out to be wrong.",
"burnWarningDescription": "Once revealed, this counts against the paste's read limit.",
"burnWarningPassword": "A wrong password costs nothing: the read is only spent once the password is right.",
"reveal": "Reveal",
"copyText": "Copy",
"downloadFile": "Download {name}",
Expand Down
3 changes: 2 additions & 1 deletion apps/app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
"readsRemaining": "Lectures restantes : {count}",
"passwordLabel": "Ce paste est protégé par un mot de passe",
"burnWarningTitle": "Révéler consomme une lecture",
"burnWarningDescription": "Une fois révélé, ceci compte dans la limite de lectures du paste — même si le mot de passe s'avère incorrect.",
"burnWarningDescription": "Une fois révélé, ceci compte dans la limite de lectures du paste.",
"burnWarningPassword": "Un mot de passe incorrect ne coûte rien : la lecture n'est décomptée qu'avec le bon mot de passe.",
"reveal": "Révéler",
"copyText": "Copier",
"downloadFile": "Télécharger {name}",
Expand Down