Versie 0.2.0
This commit is contained in:
commit
e77d8fd373
495 files changed
+81026
No files matched your search
@@ -0,0 +1,19 @@
|
||||
// Generated, do not edit. sha256:c864b8912c6f9fb6e1f43a0e7802dcf91da8cc548250568950b56366eecfca04
|
||||
import { zapContext, npubShort, compactMemo } from '../../shared/zap.js';
|
||||
import { t } from '../i18n/index.js';
|
||||
|
||||
export function memoLine(memo, direction, max = 80) {
|
||||
const z = zapContext(memo);
|
||||
let text;
|
||||
if (z) {
|
||||
const wie = npubShort(direction === 'in' ? z.sender : z.recipient);
|
||||
const kop = direction === 'in'
|
||||
? (wie ? t('tracking.zapFrom', { who: wie }) : t('tracking.zapIn'))
|
||||
: (wie ? t('tracking.zapTo', { who: wie }) : t('tracking.zapOut'));
|
||||
text = z.message ? `${kop}: "${z.message}"` : kop;
|
||||
} else {
|
||||
text = compactMemo(memo);
|
||||
}
|
||||
if (!text) return null;
|
||||
return { text: text.length > max ? `${text.slice(0, max - 1)}…` : text, title: text };
|
||||
}
|
||||
Reference in new issue
Block a user