Fixes "no robot", add launchers on Android. (#411)

* Update robohash repo url to RoboSats org

* Add external launchers

* Fix no-robot issue due to timing of initial fetchInfo

* Collect new phrases
This commit is contained in:
Reckless_Satoshi 2023-04-09 18:48:25 +00:00 committed by GitHub
parent 025d975b6c
commit e783dea305
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 73 additions and 31 deletions

View File

@ -3,32 +3,37 @@ import { useTranslation } from 'react-i18next';
import { useTheme } from '@mui/material/styles';
import QRCode from 'react-qr-code';
import {
Box,
Dialog,
DialogTitle,
DialogActions,
DialogContent,
DialogContentText,
Button,
Grid,
} from '@mui/material';
import { NewTabIcon } from '../Icons';
interface Props {
open: boolean;
onClose: () => void;
tgBotName: string;
tgToken: string;
onClickEnable: () => void;
}
const EnableTelegramDialog = ({
open,
onClose,
tgBotName,
tgToken,
onClickEnable,
}: Props): JSX.Element => {
const EnableTelegramDialog = ({ open, onClose, tgBotName, tgToken }: Props): JSX.Element => {
const { t } = useTranslation();
const theme = useTheme();
const handleClickOpenBrowser = () => {
window.open(`https://t.me/${tgBotName}?start=${tgToken}`, '_blank').focus();
setOpenEnableTelegram(false);
};
const handleOpenTG = () => {
window.open(`tg://resolve?domain=${tgBotName}&start=${tgToken}`);
};
return (
<Dialog
open={open}
@ -38,14 +43,34 @@ const EnableTelegramDialog = ({
>
<DialogTitle id='open-dispute-dialog-title'>{t('Enable TG Notifications')}</DialogTitle>
<DialogContent>
<div style={{ textAlign: 'center' }}>
<Grid container justifyContent='center'>
<Grid item>
<Box
sx={{
width: 290,
display: 'flex',
backgroundColor: theme.palette.background.paper,
alignItems: 'center',
justifyContent: 'center',
padding: '0.5em',
borderRadius: '0.3em',
border: '1px solid',
borderColor: theme.palette.mode === 'dark' ? '#434343' : '#c4c4c4',
'&:hover': {
borderColor: theme.palette.mode === 'dark' ? '#ffffff' : '#2f2f2f',
},
}}
>
<QRCode
bgColor={'rgba(255, 255, 255, 0)'}
fgColor={theme.palette.text.primary}
value={'tg://resolve?domain=' + tgBotName + '&start=' + tgToken}
size={275}
onClick={handleOpenTG}
/>
</div>
</Box>
</Grid>
</Grid>
<DialogContentText id='alert-dialog-description'>
{t(
'You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.',
@ -54,10 +79,11 @@ const EnableTelegramDialog = ({
</DialogContent>
<DialogActions>
<Button onClick={onClose}> {t('Go back')} </Button>
<Button onClick={onClickEnable} autoFocus>
{' '}
{t('Enable')}{' '}
<Button onClick={handleClickOpenBrowser} autoFocus>
{t('Browser')}
<NewTabIcon sx={{ width: '0.7em', height: '0.7em' }} />
</Button>
<Button onClick={handleOpenTG}>{t('Enable')}</Button>
</DialogActions>
</Dialog>
);

View File

@ -117,11 +117,6 @@ const ProfileDialog = ({
e.preventDefault();
};
const handleClickEnableTelegram = () => {
window.open('https://t.me/' + robot.tgBotName + '?start=' + robot.tgToken, '_blank').focus();
setOpenEnableTelegram(false);
};
const setStealthInvoice = (wantsStealth: boolean) => {
apiClient
.put(baseUrl, '/api/stealth/', { wantsStealth })
@ -238,7 +233,6 @@ const ProfileDialog = ({
onClose={() => setOpenEnableTelegram(false)}
tgBotName={robot.tgBotName}
tgToken={robot.tgToken}
onClickEnable={handleClickEnableTelegram}
/>
<ListItem>

View File

@ -48,6 +48,10 @@ export const LockInvoicePrompt = ({ order, concept }: LockInvoicePromptProps): J
);
};
const handleClickQR = () => {
window.open(`lightning:${invoice}`);
};
return (
<Grid
container
@ -82,6 +86,11 @@ export const LockInvoicePrompt = ({ order, concept }: LockInvoicePromptProps): J
justifyContent: 'center',
padding: '0.5em',
borderRadius: '0.3em',
border: '1px solid',
borderColor: theme.palette.mode === 'dark' ? '#434343' : '#c4c4c4',
'&:hover': {
borderColor: theme.palette.mode === 'dark' ? '#ffffff' : '#2f2f2f',
},
}}
>
<QRCode
@ -89,9 +98,7 @@ export const LockInvoicePrompt = ({ order, concept }: LockInvoicePromptProps): J
fgColor={theme.palette.text.primary}
value={invoice ?? 'Undefined: BOLT11 invoice not received'}
size={theme.typography.fontSize * 21.8}
onClick={() => {
systemClient.copyToClipboard(invoice);
}}
onClick={handleClickQR}
/>
</Box>
</Tooltip>

View File

@ -335,11 +335,11 @@ export const AppContextProvider = ({
useEffect(() => {
if (open.stats || open.coordinator || info.coordinatorVersion == 'v?.?.?') {
if (window.NativeRobosats === undefined || torStatus == '"Done"') {
if (window.NativeRobosats === undefined) {
fetchInfo();
}
}
}, [open.stats, open.coordinator, torStatus]);
}, [open.stats, open.coordinator]);
useEffect(() => {
// Sets Setting network from coordinator API param if accessing via web

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Activar Notificacions TG",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Seràs dut a un xat amb el bot de Telegram de Robosats. Simplement prem Començar. Tingues en compte que si actives les notificaciones de Telegram reduiràs el teu anonimat.",
"Browser": "Browser",
"Enable": "Activar",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Resum del coordinador",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Povolit TG notifikace",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Budeš přesměrován do chatu s RoboSats telegram botem. Jednoduše otevři chat a zmáčkni Start. Měj na paměti, že povolením telegram notifikací máš nížší úroveň anonymity.",
"Browser": "Browser",
"Enable": "Povolit",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Aktiviere TG-Benachrichtigungen",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Du wirst zu einem Chat mit dem RoboSats-Telegram-Bot weitergeleitet. Öffne einfach den Chat und drücke auf Start. Beachte, dass du deine Anonymität verringern könntest, wenn du Telegram-Benachrichtigungen aktivierst.",
"Browser": "Browser",
"Enable": "Aktivieren",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Enable TG Notifications",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.",
"Browser": "Browser",
"Enable": "Enable",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Activar Notificaciones TG",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Se abrirá un chat con el bot de Telegram de RoboSats. Simplemente pulsa en Empezar. Ten en cuenta que si activas las notificaciones de Telegram reducirás tu nivel de anonimato.",
"Browser": "Browser",
"Enable": "Activar",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Resumen del coordinador",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Baimendu TG Jakinarazpenak",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "RoboSats telegrama botarekin hitz egingo duzu. Zabaldu berriketa eta sakatu Start. Telegrama bidez anonimotasun maila jaitsi zenezake.",
"Browser": "Browser",
"Enable": "Baimendu",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Activer notifications TG",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Vous serez redirigé vers une conversation avec le robot telegram RoboSats. Il suffit d'ouvrir le chat et d'appuyer sur Start. Notez qu'en activant les notifications Telegram, vous risquez de réduire votre niveau d'anonymat.",
"Browser": "Browser",
"Enable": "Activer",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Attiva notifiche TG",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Sarai introdotto in conversazione con il bot RoboSats su telegram. Apri semplicemente la chat e premi Start. Considera che attivando le notifiche telegram potresti ridurre il tuo livello di anonimità.",
"Browser": "Browser",
"Enable": "Attiva",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Włącz powiadomienia TG",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Zostaniesz przeniesiony do rozmowy z botem telegramowym RoboSats. Po prostu otwórz czat i naciśnij Start. Pamiętaj, że włączenie powiadomień telegramów może obniżyć poziom anonimowości.",
"Browser": "Browser",
"Enable": "Włączyć",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Habilitar notificações do TG",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Você será levado a uma conversa com o bot do Telegram RoboSats. Basta abrir o bate-papo e pressionar Iniciar. Observe que, ao ativar as notificações de Telegram, você pode diminuir seu nível de anonimato.",
"Browser": "Browser",
"Enable": "Ativar",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Включить уведомления TG",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Вы перейдёте к разговору с Telegram ботом RoboSats. Просто откройте чат и нажмите Старт. Обратите внимание, что включив уведомления Telegram, Вы можете снизить уровень анонимности.",
"Browser": "Browser",
"Enable": "Включить",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "Aktivera TG-notifikationer",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "Du kommer att skickas till en konversation med RoboSats Telegram-bot. Öppna chatten och tryck Start. Notera att genom att aktivera Telegram-notiser så försämrar du möjligen din anonymitet.",
"Browser": "Browser",
"Enable": "Aktivera",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "ใช้การแจ้งเตือน Telegram",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "คุณจะเข้าไปยังแชทกับ telegram bot ของ RoboSats ให้คุณกด Start อย่างไรก็ตาม การใช้การแจ้งเตือน telegram จะลดระดับการปกปิดตัวตนของคุณ",
"Browser": "Browser",
"Enable": "เปิดใช้งาน",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "开启 TG 通知",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "你将被带到 RoboSats Telegram Bot 的对话中。只需打开聊天并按开始。请注意,通过开启 Telegram 通知,你可能会降低匿名程度。",
"Browser": "Browser",
"Enable": "开启",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -144,6 +144,7 @@
"#23": "Phrases in components/Dialogs/EnableTelegram.tsx",
"Enable TG Notifications": "開啟 TG 通知",
"You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.": "你將被帶到與 RoboSats Telegram Bot 的對話中。只需打開聊天並按開始。請注意,通過啟用 Telegram 通知,你可能會降低匿名程度。",
"Browser": "Browser",
"Enable": "開啟",
"#24": "Phrases in components/Dialogs/CoordinatorSummary.tsx",
"Coordinator Summary": "Coordinator Summary",

View File

@ -18,7 +18,7 @@ Pillow==9.3.0
python-decouple==3.5
requests==2.22.0
ring==0.9.1
git+https://github.com/Reckless-Satoshi/Robohash.git
git+https://github.com/RoboSats/Robohash.git
scipy==1.8.0
gunicorn==20.1.0
psycopg2==2.9.5