From b23b1764e58d5d4ab5091bb8c12701f461b1f164 Mon Sep 17 00:00:00 2001 From: Kieran Date: Mon, 20 Feb 2023 14:18:41 +0000 Subject: [PATCH] chore: misc --- README.md | 12 ++++++++++++ packages/app/src/Element/Text.tsx | 10 +++++----- packages/nostr/src/legacy/Connection.ts | 1 - packages/nostr/src/legacy/System.ts | 3 ++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f6edfbe..4aac66b 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,15 @@ To build the application and nostr package, use ``` $ yarn build ``` + +### Translations + +Translations are managed on [Crowdin](https://crowdin.com/project/snort) + +To extract translations run: +```bash +yarn workspace @snort/app intl-extract +yarn workspace @snort/app intl-compile +``` + +This will create the source file `packages/app/src/translations/en.json` \ No newline at end of file diff --git a/packages/app/src/Element/Text.tsx b/packages/app/src/Element/Text.tsx index 4742a23..1f41ab2 100644 --- a/packages/app/src/Element/Text.tsx +++ b/packages/app/src/Element/Text.tsx @@ -60,18 +60,18 @@ export default function Text({ content, tags, creator, users }: TextProps) { if (ref) { switch (ref.Key) { case "p": { - return ; + return ; } case "e": { const eText = hexToBech32("note", ref.Event).substring(0, 12); return ( - e.stopPropagation()}> + e.stopPropagation()}> #{eText} ); } case "t": { - return ; + return ; } } } @@ -92,7 +92,7 @@ export default function Text({ content, tags, creator, users }: TextProps) { if (typeof f === "string") { return f.split(InvoiceRegex).map(i => { if (i.toLowerCase().startsWith("lnbc")) { - return ; + return ; } else { return i; } @@ -109,7 +109,7 @@ export default function Text({ content, tags, creator, users }: TextProps) { if (typeof f === "string") { return f.split(HashtagRegex).map(i => { if (i.toLowerCase().startsWith("#")) { - return ; + return ; } else { return i; } diff --git a/packages/nostr/src/legacy/Connection.ts b/packages/nostr/src/legacy/Connection.ts index 7a9ce44..1e1478e 100644 --- a/packages/nostr/src/legacy/Connection.ts +++ b/packages/nostr/src/legacy/Connection.ts @@ -82,7 +82,6 @@ export default class Connection { this.EventsCallback = new Map(); this.AwaitingAuth = new Map(); this.Authed = false; - this.Connect(); } async Connect() { diff --git a/packages/nostr/src/legacy/System.ts b/packages/nostr/src/legacy/System.ts index 0001f6c..929a950 100644 --- a/packages/nostr/src/legacy/System.ts +++ b/packages/nostr/src/legacy/System.ts @@ -82,10 +82,11 @@ export class NostrSystem { /** * Connect to a NOSTR relay if not already connected */ - ConnectToRelay(address: string, options: RelaySettings) { + async ConnectToRelay(address: string, options: RelaySettings) { try { if (!this.Sockets.has(address)) { const c = new Connection(address, options); + await c.Connect(); this.Sockets.set(address, c); for (const [, s] of this.Subscriptions) { c.AddSubscription(s);