diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts index 6a44076..04d57df 100644 --- a/src/i18n/locales/ar.ts +++ b/src/i18n/locales/ar.ts @@ -227,6 +227,8 @@ export default { Autoplay: 'التشغيل التلقائي', 'Enable video autoplay on this device': 'تمكين التشغيل التلقائي للفيديو على هذا الجهاز', 'Paste or drop media files to upload': 'الصق أو اسحب ملفات الوسائط لتحميلها', - Preview: 'معاينة' + Preview: 'معاينة', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'أنت على وشك نشر حدث موقع من قبل [{{eventAuthorName}}]. أنت حالياً مسجل الدخول كـ [{{currentUsername}}]. هل أنت متأكد؟' } } diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index a3ef5d6..37fc2fe 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -233,6 +233,8 @@ export default { 'Aktiviere die automatische Video-Wiedergabe auf diesem Gerät', 'Paste or drop media files to upload': 'Füge Medien-Dateien ein oder ziehe sie hierher, um sie hochzuladen', - Preview: 'Vorschau' + Preview: 'Vorschau', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'Du bist dabei, ein Ereignis zu veröffentlichen, das von [{{eventAuthorName}}] signiert wurde. Du bist derzeit als [{{currentUsername}}] angemeldet. Bist du sicher?' } } diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 26882ac..58e2a7e 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -227,6 +227,8 @@ export default { Autoplay: 'Autoplay', 'Enable video autoplay on this device': 'Enable video autoplay on this device', 'Paste or drop media files to upload': 'Paste or drop media files to upload', - Preview: 'Preview' + Preview: 'Preview', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?' } } diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 845c606..65df85e 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -232,6 +232,8 @@ export default { 'Enable video autoplay on this device': 'Habilitar reproducción automática de video en este dispositivo', 'Paste or drop media files to upload': 'Pegar o soltar archivos multimedia para cargar', - Preview: 'Vista previa' + Preview: 'Vista previa', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'Estás a punto de publicar un evento firmado por [{{eventAuthorName}}]. Actualmente has iniciado sesión como [{{currentUsername}}]. ¿Estás seguro?' } } diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 6ee9144..dbf2d7d 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -232,6 +232,8 @@ export default { 'Activer la lecture automatique des vidéos sur cet appareil', 'Paste or drop media files to upload': 'Coller ou déposer des fichiers multimédias à télécharger', - Preview: 'Aperçu' + Preview: 'Aperçu', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'Vous êtes sur le point de publier un événement signé par [{{eventAuthorName}}]. Vous êtes actuellement connecté en tant que [{{currentUsername}}]. Êtes-vous sûr ?' } } diff --git a/src/i18n/locales/it.ts b/src/i18n/locales/it.ts index f570624..85451dd 100644 --- a/src/i18n/locales/it.ts +++ b/src/i18n/locales/it.ts @@ -231,6 +231,8 @@ export default { 'Enable video autoplay on this device': 'Abilita riproduzione automatica video su questo dispositivo', 'Paste or drop media files to upload': 'Incolla o trascina i file multimediali per caricarli', - Preview: 'Anteprima' + Preview: 'Anteprima', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'Stai per pubblicare un evento firmato da [{{eventAuthorName}}]. Attualmente sei connesso come [{{currentUsername}}]. Sei sicuro?' } } diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index c7a59d2..c224a1d 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -228,6 +228,8 @@ export default { Autoplay: '自動再生', 'Enable video autoplay on this device': 'このデバイスでのビデオ自動再生を有効にする', 'Paste or drop media files to upload': 'メディアファイルを貼り付けるかドロップしてアップロード', - Preview: 'プレビュー' + Preview: 'プレビュー', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'あなたは[{{eventAuthorName}}]によって署名されたイベントを公開しようとしています。現在[{{currentUsername}}]としてログインしています。よろしいですか?' } } diff --git a/src/i18n/locales/pl.ts b/src/i18n/locales/pl.ts index 5147f80..82e3cac 100644 --- a/src/i18n/locales/pl.ts +++ b/src/i18n/locales/pl.ts @@ -230,6 +230,8 @@ export default { 'Enable video autoplay on this device': 'Włącz automatyczne odtwarzanie wideo na tym urządzeniu', 'Paste or drop media files to upload': 'Wklej lub upuść pliki multimedialne, aby przesłać', - Preview: 'Podgląd' + Preview: 'Podgląd', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'Zaraz opublikujesz zdarzenie podpisane przez [{{eventAuthorName}}]. Obecnie jesteś zalogowany jako [{{currentUsername}}]. Czy jesteś pewien?' } } diff --git a/src/i18n/locales/pt-BR.ts b/src/i18n/locales/pt-BR.ts index 2ea07df..1b6dd87 100644 --- a/src/i18n/locales/pt-BR.ts +++ b/src/i18n/locales/pt-BR.ts @@ -230,6 +230,8 @@ export default { 'Enable video autoplay on this device': 'Habilitar reprodução automática de vídeo neste dispositivo', 'Paste or drop media files to upload': 'Cole ou arraste arquivos de mídia para fazer upload', - Preview: 'Pré-visualização' + Preview: 'Pré-visualização', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'Você está prestes a publicar um evento assinado por [{{eventAuthorName}}]. Você está atualmente logado como [{{currentUsername}}]. Tem certeza?' } } diff --git a/src/i18n/locales/pt-PT.ts b/src/i18n/locales/pt-PT.ts index c83e5e6..553987d 100644 --- a/src/i18n/locales/pt-PT.ts +++ b/src/i18n/locales/pt-PT.ts @@ -231,6 +231,8 @@ export default { 'Enable video autoplay on this device': 'Habilitar reprodução automática de vídeo neste dispositivo', 'Paste or drop media files to upload': 'Cole ou solte arquivos de mídia para fazer upload', - Preview: 'Pré-visualização' + Preview: 'Pré-visualização', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'Você está prestes a publicar um evento assinado por [{{eventAuthorName}}]. Você está atualmente logado como [{{currentUsername}}]. Tem certeza?' } } diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index dfc9731..9b5f8ee 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -231,6 +231,8 @@ export default { Autoplay: 'Автовоспроизведение', 'Enable video autoplay on this device': 'Включить автовоспроизведение видео на этом устройстве', 'Paste or drop media files to upload': 'Вставьте или перетащите медиафайлы для загрузки', - Preview: 'Предварительный просмотр' + Preview: 'Предварительный просмотр', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + 'Вы собираетесь опубликовать событие, подписанное [{{eventAuthorName}}]. Вы в данный момент вошли как [{{currentUsername}}]. Вы уверены?' } } diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index 724f3ed..eaa1803 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -228,6 +228,8 @@ export default { Autoplay: '自动播放', 'Enable video autoplay on this device': '在此设备上启用视频自动播放', 'Paste or drop media files to upload': '支持粘贴或拖放媒体文件进行上传', - Preview: '预览' + Preview: '预览', + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?': + '您即将发布一条由 [{{eventAuthorName}}] 签名的事件。您当前以 [{{currentUsername}}] 登录。确定吗?' } } diff --git a/src/providers/NostrProvider/index.tsx b/src/providers/NostrProvider/index.tsx index 0e13430..dd04b18 100644 --- a/src/providers/NostrProvider/index.tsx +++ b/src/providers/NostrProvider/index.tsx @@ -514,11 +514,30 @@ export function NostrProvider({ children }: { children: React.ReactNode }) { } const event = await signEvent(draftEvent) - const relays = specifiedRelayUrls?.length - ? specifiedRelayUrls - : (relayList?.write.slice(0, 10) ?? []) - .concat(Array.from(new Set(additionalRelayUrls)) ?? []) - .concat(client.getCurrentRelayUrls()) + + if (event.pubkey !== account.pubkey) { + const eventAuthor = await client.fetchProfile(event.pubkey) + const result = confirm( + t( + 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?', + { eventAuthorName: eventAuthor?.username, currentUsername: profile?.username } + ) + ) + if (!result) { + throw new Error(t('Cancelled')) + } + } + + let relays: string[] + if (specifiedRelayUrls?.length) { + relays = specifiedRelayUrls + } else { + const relayList = await client.fetchRelayList(event.pubkey) + relays = (relayList?.write.slice(0, 10) ?? []) + .concat(Array.from(new Set(additionalRelayUrls)) ?? []) + .concat(client.getCurrentRelayUrls()) + } + if (!relays.length) { relays.push(...BIG_RELAY_URLS) }