Skip to content

Commit

Permalink
removed appRole entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryongchan committed Jan 29, 2024
1 parent 02ca401 commit 5983b2d
Show file tree
Hide file tree
Showing 25 changed files with 199 additions and 570 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"editor.defaultFormatter": null,
"[typescriptreact]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.execArgv": null,
"[typescript]": {
Expand Down
102 changes: 101 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.0.0",
"typedoc": "^0.25.7",
"typescript": "^4.9.5",
"url-loader": "^4.1.1",
"webpack": "^5.75.0",
Expand Down
37 changes: 9 additions & 28 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ import ImportSeedPhrase from './components/auth/ImportSeedPhrase';
import Mnemonics from './components/auth/Mnemonics';
import Profile from './components/profile/Profile';
import NavigationLayoutTransitionWrapper from './components/navigation/NavigationLayoutTransitionWrapper';
import HostTxnDashboard from './components/transactions/HostTxnDashboard';
import HostBillingDashboard from './components/billing/dashboard/HostBillingDashboard';
import TxnDashboard from './components/transactions/TxnDashboard';
import BillingDashboard from './components/billing/dashboard/BillingDashboard';
import TransactionDetails from './components/transactions/TransactionDetails';
import RoleSelection from './components/auth/RoleSelection';
import Payment from './components/payment/Payment';
import Settings from './components/settings/Settings';
// import useHeartbeatHook from './utils/useHeartbeatHook';
Expand All @@ -39,13 +38,7 @@ const PrivateRoutes = () => {
const isAuthenticated = useSelector(
(state: RootState) => state.userReducer.authenticated
);
return isAuthenticated ? (
<Outlet />
) : (
<Navigate
to={'/hosttxndashboard'}
/>
);
return isAuthenticated ? <Outlet /> : <Navigate to="/txndashboard" />;
};

const RootRoute = () => {
Expand All @@ -55,11 +48,7 @@ const RootRoute = () => {
const did = window.electron.store.get('did');

if (isAuthenticated) {
return (
<Navigate
to={'/hosttxndashboard'}
/>
);
return <Navigate to="/txndashboard" />;
}
return did === '' ? <Register /> : <Login />;
};
Expand Down Expand Up @@ -102,14 +91,6 @@ const Animated = () => {
</Transitions>
}
/>
<Route
path="/roleselection"
element={
<Transitions>
<RoleSelection />
</Transitions>
}
/>
<Route
path="/import-seed-phrase"
element={
Expand All @@ -123,7 +104,7 @@ const Animated = () => {
path="/"
element={
<Transitions>
<HostTxnDashboard />
<TxnDashboard />
</Transitions>
}
/>
Expand All @@ -136,18 +117,18 @@ const Animated = () => {
}
/>
<Route
path="/hosttxndashboard"
path="/txndashboard"
element={
<Transitions>
<HostTxnDashboard />
<TxnDashboard />
</Transitions>
}
/>
<Route
path="/hostbillingdashboard"
path="/billingdashboard"
element={
<Transitions>
<HostBillingDashboard />
<BillingDashboard />
</Transitions>
}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Login = () => {
const userIsAuthenticated = await handleLogin(password);
if (userIsAuthenticated) {
actions.setAuthenticated(true);
navigate('/hosttxndashboard');
navigate('/txndashboard');
}
} catch (error) {
if (error instanceof Error) {
Expand Down
Loading

0 comments on commit 5983b2d

Please sign in to comment.