feat: add confirmation prompt when publishing event signed by a different user
This commit is contained in:
@@ -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}}]. هل أنت متأكد؟'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 ?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}}]としてログインしています。よろしいですか?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}}]. Вы уверены?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}}] 登录。确定吗?'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user