Add delay tor connected status, remove token from profile dialog

This commit is contained in:
Reckless_Satoshi 2023-02-22 07:55:51 -08:00
parent 48149e0889
commit 95f4e1708c
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
19 changed files with 11 additions and 73 deletions

View File

@ -5,6 +5,7 @@ repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks' - repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v2.3.0 rev: v2.3.0
hooks: hooks:
- id: check-merge-conflict
- id: check-yaml - id: check-yaml
- id: check-toml - id: check-toml
- id: mixed-line-ending - id: mixed-line-ending
@ -18,7 +19,6 @@ repos:
- '--no-ensure-ascii' - '--no-ensure-ascii'
- id: check-builtin-literals - id: check-builtin-literals
- id: check-docstring-first - id: check-docstring-first
- id: check-merge-conflict
- repo: local - repo: local
hooks: hooks:
- id: collect-phrases - id: collect-phrases
@ -27,7 +27,7 @@ repos:
- commit - commit
- merge-commit - merge-commit
language: system language: system
files: ^frontend/ files: ^frontend/src/
types_or: [javascript, jsx, ts, tsx] # uses https://github.com/pre-commit/identify types_or: [javascript, jsx, ts, tsx] # uses https://github.com/pre-commit/identify
entry: bash -c 'cd frontend/static/locales && python3 collect_phrases.py' entry: bash -c 'cd frontend/static/locales && python3 collect_phrases.py'
- repo: local - repo: local

View File

@ -33,7 +33,8 @@ const App = (): JSX.Element => {
useEffect(() => { useEffect(() => {
window.addEventListener('torStatus', (event) => { window.addEventListener('torStatus', (event) => {
setTorStatus(event?.detail); // UX improv: delay the "Conencted" status by 10 secs to avoid long waits for first requests
setTimeout(() => setTorStatus(event?.detail), event?.detail === '"Done"' ? 10000 : 0);
}); });
}, []); }, []);

View File

@ -26,7 +26,13 @@ const SettingsPage = ({
return ( return (
<Paper <Paper
elevation={12} elevation={12}
sx={{ padding: '0.6em', width: '18em', maxHeight: `${maxHeight}em`, overflow: 'auto' }} sx={{
padding: '0.6em',
width: '18em',
maxHeight: `${maxHeight}em`,
overflow: 'auto',
overflowX: 'clip',
}}
> >
<Grid container> <Grid container>
<Grid item> <Grid item>

View File

@ -81,15 +81,6 @@ const ProfileDialog = ({
}); });
}, []); }, []);
const copyTokenHandler = () => {
const robotToken = systemClient.getItem('robot_token');
if (robotToken) {
systemClient.copyToClipboard(robotToken);
setRobot({ ...robot, copiedToken: true });
}
};
const copyReferralCodeHandler = () => { const copyReferralCodeHandler = () => {
systemClient.copyToClipboard(`http://${host}/robot/${robot.referralCode}`); systemClient.copyToClipboard(`http://${host}/robot/${robot.referralCode}`);
}; };
@ -238,36 +229,6 @@ const ProfileDialog = ({
</ListItem> </ListItem>
)} )}
<ListItem>
<ListItemIcon>
<PasswordIcon />
</ListItemIcon>
<ListItemText secondary={t('Your token (will not remain here)')}>
{systemClient.getItem('robot_token') ? (
<TextField
disabled
sx={{ width: '100%', maxWidth: '450px' }}
label={t('Back it up!')}
value={systemClient.getItem('robot_token')}
variant='filled'
size='small'
InputProps={{
endAdornment: (
<Tooltip disableHoverListener enterTouchDelay={0} title={t('Copied!') || ''}>
<IconButton onClick={copyTokenHandler}>
<ContentCopy color='inherit' />
</IconButton>
</Tooltip>
),
}}
/>
) : (
t('Cannot remember')
)}
</ListItemText>
</ListItem>
<Divider /> <Divider />
<EnableTelegramDialog <EnableTelegramDialog

View File

@ -238,8 +238,6 @@
"Inactive order": "Ordre inactiva", "Inactive order": "Ordre inactiva",
"No active orders": "No hi ha ordres actives", "No active orders": "No hi ha ordres actives",
"You do not have previous orders": "No tens ordres prèvies", "You do not have previous orders": "No tens ordres prèvies",
"Your token (will not remain here)": "El teu token (no romandrà aquí)",
"Cannot remember": "No es pot recordar",
"Telegram enabled": "Telegram activat", "Telegram enabled": "Telegram activat",
"Enable Telegram Notifications": "Notificar en Telegram", "Enable Telegram Notifications": "Notificar en Telegram",
"Use stealth invoices": "Factures sigil·loses", "Use stealth invoices": "Factures sigil·loses",

View File

@ -238,8 +238,6 @@
"Inactive order": "Neaktivní nabídka", "Inactive order": "Neaktivní nabídka",
"No active orders": "Žádné aktivní nabídky", "No active orders": "Žádné aktivní nabídky",
"You do not have previous orders": "Nemáš předchozí objednávky", "You do not have previous orders": "Nemáš předchozí objednávky",
"Your token (will not remain here)": "Tvůj token (nezůstane zde)",
"Cannot remember": "Nepamatuje si",
"Telegram enabled": "Telegram povolen", "Telegram enabled": "Telegram povolen",
"Enable Telegram Notifications": "Povolit Telegram notifikace", "Enable Telegram Notifications": "Povolit Telegram notifikace",
"Use stealth invoices": "Use stealth invoices", "Use stealth invoices": "Use stealth invoices",

View File

@ -238,8 +238,6 @@
"Inactive order": "Inaktive Order", "Inactive order": "Inaktive Order",
"No active orders": "Keine aktive Order", "No active orders": "Keine aktive Order",
"You do not have previous orders": "Du hast keine vorherige Order", "You do not have previous orders": "Du hast keine vorherige Order",
"Your token (will not remain here)": "Dein Token (wird hier nicht gespeichert)",
"Cannot remember": "Kann mich nicht erinnern",
"Telegram enabled": "Telegram aktiviert", "Telegram enabled": "Telegram aktiviert",
"Enable Telegram Notifications": "Telegram-Benachrichtigungen aktivieren", "Enable Telegram Notifications": "Telegram-Benachrichtigungen aktivieren",
"Use stealth invoices": "Use stealth invoices", "Use stealth invoices": "Use stealth invoices",

View File

@ -238,8 +238,6 @@
"Inactive order": "Inactive order", "Inactive order": "Inactive order",
"No active orders": "No active orders", "No active orders": "No active orders",
"You do not have previous orders": "You do not have previous orders", "You do not have previous orders": "You do not have previous orders",
"Your token (will not remain here)": "Your token (will not remain here)",
"Cannot remember": "Cannot remember",
"Telegram enabled": "Telegram enabled", "Telegram enabled": "Telegram enabled",
"Enable Telegram Notifications": "Enable Telegram Notifications", "Enable Telegram Notifications": "Enable Telegram Notifications",
"Use stealth invoices": "Use stealth invoices", "Use stealth invoices": "Use stealth invoices",

View File

@ -238,8 +238,6 @@
"Inactive order": "Orden inactiva", "Inactive order": "Orden inactiva",
"No active orders": "No hay órdenes activas", "No active orders": "No hay órdenes activas",
"You do not have previous orders": "No tienes órdenes previas", "You do not have previous orders": "No tienes órdenes previas",
"Your token (will not remain here)": "Tu token (no permanecerá aquí)",
"Cannot remember": "Se olvidó",
"Telegram enabled": "Telegram activado", "Telegram enabled": "Telegram activado",
"Enable Telegram Notifications": "Notificar en Telegram", "Enable Telegram Notifications": "Notificar en Telegram",
"Use stealth invoices": "Facturas sigilosas", "Use stealth invoices": "Facturas sigilosas",

View File

@ -238,8 +238,6 @@
"Inactive order": "Eskaera ez aktiboa", "Inactive order": "Eskaera ez aktiboa",
"No active orders": "Eskaera aktiborik ez", "No active orders": "Eskaera aktiborik ez",
"You do not have previous orders": "Ez duzu aurretik eskaerarik", "You do not have previous orders": "Ez duzu aurretik eskaerarik",
"Your token (will not remain here)": "Zure tokena (ez da hemen mantenduko)",
"Cannot remember": "Ahaztu da",
"Telegram enabled": "Telegram baimendua", "Telegram enabled": "Telegram baimendua",
"Enable Telegram Notifications": "Baimendu Telegram Jakinarazpenak", "Enable Telegram Notifications": "Baimendu Telegram Jakinarazpenak",
"Use stealth invoices": "Erabili ezkutuko fakturak", "Use stealth invoices": "Erabili ezkutuko fakturak",

View File

@ -238,8 +238,6 @@
"Inactive order": "Inactive order", "Inactive order": "Inactive order",
"No active orders": "Aucun ordre actif", "No active orders": "Aucun ordre actif",
"You do not have previous orders": "You do not have previous orders", "You do not have previous orders": "You do not have previous orders",
"Your token (will not remain here)": "Votre jeton (ne restera pas ici)",
"Cannot remember": "Impossible de se souvenir",
"Telegram enabled": "Telegram activé", "Telegram enabled": "Telegram activé",
"Enable Telegram Notifications": "Activer les notifications Telegram", "Enable Telegram Notifications": "Activer les notifications Telegram",
"Use stealth invoices": "Use stealth invoices", "Use stealth invoices": "Use stealth invoices",

View File

@ -238,8 +238,6 @@
"Inactive order": "Ordine inattivo", "Inactive order": "Ordine inattivo",
"No active orders": "Nessun ordine attivo", "No active orders": "Nessun ordine attivo",
"You do not have previous orders": "Non hai ordini precedenti", "You do not have previous orders": "Non hai ordini precedenti",
"Your token (will not remain here)": "Il tuo gettone (Non resterà qui)",
"Cannot remember": "Dimenticato",
"Telegram enabled": "Telegram attivato", "Telegram enabled": "Telegram attivato",
"Enable Telegram Notifications": "Attiva notifiche Telegram", "Enable Telegram Notifications": "Attiva notifiche Telegram",
"Use stealth invoices": "Use stealth invoices", "Use stealth invoices": "Use stealth invoices",

View File

@ -238,8 +238,6 @@
"Inactive order": "Inactive order", "Inactive order": "Inactive order",
"No active orders": "Brak aktywnych zamówień", "No active orders": "Brak aktywnych zamówień",
"You do not have previous orders": "You do not have previous orders", "You do not have previous orders": "You do not have previous orders",
"Your token (will not remain here)": "Twój token (nie pozostanie tutaj)",
"Cannot remember": "niemożliwe do zapamiętania",
"Telegram enabled": "Telegram włączony", "Telegram enabled": "Telegram włączony",
"Enable Telegram Notifications": "Włącz powiadomienia telegramu", "Enable Telegram Notifications": "Włącz powiadomienia telegramu",
"Use stealth invoices": "Use stealth invoices", "Use stealth invoices": "Use stealth invoices",

View File

@ -238,8 +238,6 @@
"Inactive order": "Ordem inativa", "Inactive order": "Ordem inativa",
"No active orders": "Nenhuma ordem ativa", "No active orders": "Nenhuma ordem ativa",
"You do not have previous orders": "Você não tem ordens anteriores", "You do not have previous orders": "Você não tem ordens anteriores",
"Your token (will not remain here)": "Seu token (não permanecerá aqui)",
"Cannot remember": "Não consigo lembrar",
"Telegram enabled": "Telegram ativado", "Telegram enabled": "Telegram ativado",
"Enable Telegram Notifications": "Habilitar notificações do Telegram", "Enable Telegram Notifications": "Habilitar notificações do Telegram",
"Use stealth invoices": "Use stealth invoices", "Use stealth invoices": "Use stealth invoices",

View File

@ -238,8 +238,6 @@
"Inactive order": "Неактивный ордер", "Inactive order": "Неактивный ордер",
"No active orders": "Нет активных ордеров", "No active orders": "Нет активных ордеров",
"You do not have previous orders": "У Вас нет предыдущих ордеров", "You do not have previous orders": "У Вас нет предыдущих ордеров",
"Your token (will not remain here)": "Ваш токен (здесь не останется)",
"Cannot remember": "Не могу вспомнить",
"Telegram enabled": "Telegram включен", "Telegram enabled": "Telegram включен",
"Enable Telegram Notifications": "Включить уведомления Telegram", "Enable Telegram Notifications": "Включить уведомления Telegram",
"Use stealth invoices": "Использовать стелс инвойсы", "Use stealth invoices": "Использовать стелс инвойсы",

View File

@ -238,8 +238,6 @@
"Inactive order": "Inaktiv order", "Inactive order": "Inaktiv order",
"No active orders": "Inga aktiva ordrar", "No active orders": "Inga aktiva ordrar",
"You do not have previous orders": "Du har inga tidigare ordrar", "You do not have previous orders": "Du har inga tidigare ordrar",
"Your token (will not remain here)": "Din token (kommer ej finnas kvar här)",
"Cannot remember": "Glömt bort",
"Telegram enabled": "Telegram aktiverat", "Telegram enabled": "Telegram aktiverat",
"Enable Telegram Notifications": "Aktivera Telegram-notiser", "Enable Telegram Notifications": "Aktivera Telegram-notiser",
"Use stealth invoices": "Use stealth invoices", "Use stealth invoices": "Use stealth invoices",

View File

@ -238,8 +238,6 @@
"Inactive order": "รายการที่ไม่ได้ดำเนินการอยู่", "Inactive order": "รายการที่ไม่ได้ดำเนินการอยู่",
"No active orders": "ไม่มีรายการที่กำลังดำเนินการอยู่", "No active orders": "ไม่มีรายการที่กำลังดำเนินการอยู่",
"You do not have previous orders": "คุณไม่มีรายการก่อนหน้านี้", "You do not have previous orders": "คุณไม่มีรายการก่อนหน้านี้",
"Your token (will not remain here)": "token ของคุณ (แพล้ตฟอร์มไม่ได้บันทึกให้คุณ)",
"Cannot remember": "จำไม่ได้",
"Telegram enabled": "เปิดใช้ Telegram แล้ว", "Telegram enabled": "เปิดใช้ Telegram แล้ว",
"Enable Telegram Notifications": "เปิดใช้การแจ้งเตือนผ่านทาง Telegram", "Enable Telegram Notifications": "เปิดใช้การแจ้งเตือนผ่านทาง Telegram",
"Use stealth invoices": "ใช้งาน stealth invoices", "Use stealth invoices": "ใช้งาน stealth invoices",

View File

@ -238,8 +238,6 @@
"Inactive order": "不活跃订单", "Inactive order": "不活跃订单",
"No active orders": "没有活跃的订单", "No active orders": "没有活跃的订单",
"You do not have previous orders": "你没有之前的订单", "You do not have previous orders": "你没有之前的订单",
"Your token (will not remain here)": "你的令牌(不会留在此地)",
"Cannot remember": "记不得",
"Telegram enabled": "Telegram 已开启", "Telegram enabled": "Telegram 已开启",
"Enable Telegram Notifications": "开启 Telegram 通知", "Enable Telegram Notifications": "开启 Telegram 通知",
"Use stealth invoices": "使用隐形发票", "Use stealth invoices": "使用隐形发票",

View File

@ -238,8 +238,6 @@
"Inactive order": "不活躍訂單", "Inactive order": "不活躍訂單",
"No active orders": "沒有活躍的訂單", "No active orders": "沒有活躍的訂單",
"You do not have previous orders": "你沒有之前的訂單", "You do not have previous orders": "你沒有之前的訂單",
"Your token (will not remain here)": "你的令牌 (不會留在此地)",
"Cannot remember": "記不得",
"Telegram enabled": "Telegram 已開啟", "Telegram enabled": "Telegram 已開啟",
"Enable Telegram Notifications": "開啟 Telegram 通知", "Enable Telegram Notifications": "開啟 Telegram 通知",
"Use stealth invoices": "使用隱形發票", "Use stealth invoices": "使用隱形發票",