diff --git a/src/Pages/settings/Relays.tsx b/src/Pages/settings/Relays.tsx
index 455e2e3b..e586f16a 100644
--- a/src/Pages/settings/Relays.tsx
+++ b/src/Pages/settings/Relays.tsx
@@ -2,6 +2,7 @@ import { useState } from "react";
import { FormattedMessage } from "react-intl";
import { useDispatch, useSelector } from "react-redux";
+import { randomSample } from "Util";
import Relay from "Element/Relay";
import useEventPublisher from "Feed/EventPublisher";
import { RootState } from "State/Store";
@@ -20,6 +21,14 @@ const RelaySettingsPage = () => {
const ev = await publisher.saveRelays();
publisher.broadcast(ev);
publisher.broadcastForBootstrap(ev);
+ try {
+ const onlineRelays = await fetch("https://api.nostr.watch/v1/online").then(r => r.json());
+ const settingsEv = await publisher.saveRelaysSettings();
+ const rs = Object.keys(relays).concat(randomSample(onlineRelays, 20));
+ publisher.broadcastAll(settingsEv, rs);
+ } catch (error) {
+ console.error(error);
+ }
}
function addRelay() {
diff --git a/src/Pages/settings/messages.ts b/src/Pages/settings/messages.ts
index c28bc88b..11cdf501 100644
--- a/src/Pages/settings/messages.ts
+++ b/src/Pages/settings/messages.ts
@@ -55,4 +55,6 @@ export default defineMessages({
DisplayName: { defaultMessage: "Display name" },
Buy: { defaultMessage: "Buy" },
Nip05: { defaultMessage: "NIP-05" },
+ ReactionEmoji: { defaultMessage: "Reaction emoji" },
+ ReactionEmojiHelp: { defaultMessage: "Emoji to send when reactiong to a note" },
});
diff --git a/src/State/Login.ts b/src/State/Login.ts
index 202aac6a..8e892dd3 100644
--- a/src/State/Login.ts
+++ b/src/State/Login.ts
@@ -26,6 +26,11 @@ export interface UserPreferences {
*/
enableReactions: boolean;
+ /**
+ * Reaction emoji
+ */
+ reactionEmoji: string;
+
/**
* Automatically load media (show link only) (bandwidth/privacy)
*/
@@ -176,6 +181,7 @@ export const InitState = {
dmInteraction: 0,
preferences: {
enableReactions: true,
+ reactionEmoji: "+",
autoLoadMedia: "follows-only",
theme: "system",
confirmReposts: false,
diff --git a/src/Util.ts b/src/Util.ts
index 2e14ec2b..b63c2168 100644
--- a/src/Util.ts
+++ b/src/Util.ts
@@ -185,3 +185,8 @@ export function unwrap(v: T | undefined | null): T {
}
return v;
}
+
+export function randomSample(coll: T[], size: number) {
+ const random = [...coll];
+ return random.sort(() => (Math.random() >= 0.5 ? 1 : -1)).slice(0, size);
+}
diff --git a/src/lang.json b/src/lang.json
index dbcdb05b..26eb6253 100644
--- a/src/lang.json
+++ b/src/lang.json
@@ -383,6 +383,9 @@
"e7qqly": {
"string": "Mark All Read"
},
+ "eHAneD": {
+ "string": "Reaction emoji"
+ },
"eJj8HD": {
"string": "Get Verified"
},
@@ -404,6 +407,9 @@
"gDZkld": {
"string": "Snort is a Nostr UI, nostr is a decentralised protocol for saving and distributing \"notes\"."
},
+ "gDzDRs": {
+ "string": "Emoji to send when reactiong to a note"
+ },
"gjBiyj": {
"string": "Loading..."
},
diff --git a/src/translations/en.json b/src/translations/en.json
index d0e89c97..b839bbd3 100644
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -127,6 +127,7 @@
"d7d0/x": "LN Address",
"dOQCL8": "Display name",
"e7qqly": "Mark All Read",
+ "eHAneD": "Reaction emoji",
"eJj8HD": "Get Verified",
"eR3YIn": "Posts",
"filwqD": "Read",
@@ -134,6 +135,7 @@
"g5pX+a": "About",
"gBdUXk": "Save your keys!",
"gDZkld": "Snort is a Nostr UI, nostr is a decentralised protocol for saving and distributing \"notes\".",
+ "gDzDRs": "Emoji to send when reactiong to a note",
"gjBiyj": "Loading...",
"hCUivF": "Notes will stream in real time into global and posts tab",
"hK5ZDk": "the world",
@@ -209,4 +211,4 @@
"zjJZBd": "You're ready!",
"zonsdq": "Failed to load LNURL service",
"zvCDao": "Automatically show latest notes"
-}
\ No newline at end of file
+}
diff --git a/src/translations/es.json b/src/translations/es.json
index c9590df8..88228f03 100644
--- a/src/translations/es.json
+++ b/src/translations/es.json
@@ -111,6 +111,7 @@
"Pages.Notes": "Notas",
"Pages.Posts": "Notas",
"Pages.Reactions": "Reacciones",
+ "Pages.Relays": "",
"Pages.Sats": "{n} {n, plural, =1 {sat} other {sats}}",
"Pages.Search": "Búsqueda",
"Pages.SearchPlaceholder": "Buscar...",
@@ -201,6 +202,8 @@
"Pages.settings.Preferences": "Preferencias",
"Pages.settings.PrivateKey": "Tu Clave Privada (no la compartas con nadie) es",
"Pages.settings.Profile": "Perfil",
+ "Pages.settings.ReactionEmoji": "",
+ "Pages.settings.ReactionEmojiHelp": "",
"Pages.settings.Relays": "Relays",
"Pages.settings.Remove": "Eliminar",
"Pages.settings.Save": "Guardar",
diff --git a/src/translations/fr.json b/src/translations/fr.json
index 074fdf79..3ff3305f 100644
--- a/src/translations/fr.json
+++ b/src/translations/fr.json
@@ -110,6 +110,7 @@
"Pages.Notes": "Notes",
"Pages.Posts": "Publications",
"Pages.Reactions": "Réactions",
+ "Pages.Relays": "",
"Pages.Sats": "{n} {n, plural, =1 {sat} other {sats}}",
"Pages.Search": "Chercher",
"Pages.SearchPlaceholder": "Chercher...",
@@ -200,6 +201,8 @@
"Pages.settings.Preferences": "Préférences",
"Pages.settings.PrivateKey": "Votre Clé Privée Est (ne la partagez avec personne)",
"Pages.settings.Profile": "Profil",
+ "Pages.settings.ReactionEmoji": "",
+ "Pages.settings.ReactionEmojiHelp": "",
"Pages.settings.Relays": "Relais",
"Pages.settings.Remove": "Retirer",
"Pages.settings.Save": "Sauvegarder",
diff --git a/src/translations/ja.json b/src/translations/ja.json
index 2171e6bd..ae1c6a44 100644
--- a/src/translations/ja.json
+++ b/src/translations/ja.json
@@ -112,6 +112,7 @@
"Pages.Posts": "ポスト",
"Pages.Reactions": "リアクション",
"Pages.Sats": "{n} {n, plural, =1 {sat} other {sats}}",
+ "Pages.Relays": "",
"Pages.Search": "検索",
"Pages.SearchPlaceholder": "検索する",
"Pages.Settings": "設定",
@@ -201,6 +202,8 @@
"Pages.settings.Preferences": "ユーザー設定",
"Pages.settings.PrivateKey": "あなたの秘密鍵(誰とも共有しないこと)",
"Pages.settings.Profile": "プロフィール",
+ "Pages.settings.ReactionEmoji": "",
+ "Pages.settings.ReactionEmojiHelp": "",
"Pages.settings.Relays": "リレー",
"Pages.settings.Remove": "削除",
"Pages.settings.Save": "保存",
diff --git a/src/translations/zh.json b/src/translations/zh.json
index b4f6c6cb..e8a00cef 100644
--- a/src/translations/zh.json
+++ b/src/translations/zh.json
@@ -111,6 +111,7 @@
"Pages.Notes": "",
"Pages.Posts": "",
"Pages.Reactions": "",
+ "Pages.Relays": "",
"Pages.Sats": "",
"Pages.Search": "",
"Pages.SearchPlaceholder": "",
@@ -201,6 +202,8 @@
"Pages.settings.Preferences": "",
"Pages.settings.PrivateKey": "",
"Pages.settings.Profile": "",
+ "Pages.settings.ReactionEmoji": "",
+ "Pages.settings.ReactionEmojiHelp": "",
"Pages.settings.Relays": "",
"Pages.settings.Remove": "",
"Pages.settings.Save": "",