diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be6e33e3..2181decf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ repos: - repo: 'https://github.com/pre-commit/pre-commit-hooks' rev: v2.3.0 hooks: + - id: check-merge-conflict - id: check-yaml - id: check-toml - id: mixed-line-ending @@ -18,7 +19,6 @@ repos: - '--no-ensure-ascii' - id: check-builtin-literals - id: check-docstring-first - - id: check-merge-conflict - repo: local hooks: - id: collect-phrases @@ -27,7 +27,7 @@ repos: - commit - merge-commit language: system - files: ^frontend/ + files: ^frontend/src/ types_or: [javascript, jsx, ts, tsx] # uses https://github.com/pre-commit/identify entry: bash -c 'cd frontend/static/locales && python3 collect_phrases.py' - repo: local diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 0b15fa0c..21ca5d04 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -33,7 +33,8 @@ const App = (): JSX.Element => { useEffect(() => { 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); }); }, []); diff --git a/frontend/src/basic/SettingsPage/index.tsx b/frontend/src/basic/SettingsPage/index.tsx index 7e23403a..ecd22d35 100644 --- a/frontend/src/basic/SettingsPage/index.tsx +++ b/frontend/src/basic/SettingsPage/index.tsx @@ -26,7 +26,13 @@ const SettingsPage = ({ return ( diff --git a/frontend/src/components/Dialogs/Profile.tsx b/frontend/src/components/Dialogs/Profile.tsx index b242c004..3c8b580a 100644 --- a/frontend/src/components/Dialogs/Profile.tsx +++ b/frontend/src/components/Dialogs/Profile.tsx @@ -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 = () => { systemClient.copyToClipboard(`http://${host}/robot/${robot.referralCode}`); }; @@ -238,36 +229,6 @@ const ProfileDialog = ({ )} - - - - - - - {systemClient.getItem('robot_token') ? ( - - - - - - ), - }} - /> - ) : ( - t('Cannot remember') - )} - - -