Skip to content

Commit

Permalink
chore: minor todos and remove app type conditional for choosing react…
Browse files Browse the repository at this point in the history
… router type
  • Loading branch information
rolznz committed Jan 17, 2024
1 parent 912b028 commit 09cc94d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
15 changes: 3 additions & 12 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
HashRouter,
Routes,
Route,
Navigate,
BrowserRouter,
} from "react-router-dom";
import { HashRouter, Routes, Route, Navigate } from "react-router-dom";

import Navbar from "src/components/Navbar";
import Footer from "src/components/Footer";
Expand All @@ -21,9 +15,6 @@ import { useInfo } from "./hooks/useInfo";
import Loading from "./components/Loading";
import { Setup } from "./screens/Setup";

const RouterComponent =
import.meta.env.VITE_APP_TYPE === "WAILS" ? HashRouter : BrowserRouter;

function App() {
const { data: info } = useInfo();

Expand All @@ -34,7 +25,7 @@ function App() {
return (
<div className="bg:white dark:bg-black min-h-full">
<Toaster />
<RouterComponent>
<HashRouter>
<Routes>
<Route path="/" element={<Navbar />}>
<Route
Expand All @@ -57,7 +48,7 @@ function App() {
<Route path="/*" element={<NotFound />} />
</Routes>
<Footer />
</RouterComponent>
</HashRouter>
</div>
);
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const request = async <T>(
...args: Parameters<typeof fetch>
): Promise<T | undefined> => {
try {
// TODO: can we use a different request file at build time so no conditional / env variable is needed?
switch (import.meta.env.VITE_APP_TYPE) {
case "WAILS": {
const res = await WailsRequestRouter(
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func main() {
ctx: ctx,
}

// TODO: remove Datadog etc.
if os.Getenv("DATADOG_AGENT_URL") != "" {
tracer.Start(tracer.WithService("nostr-wallet-connect"))
defer tracer.Stop()
Expand All @@ -144,6 +145,7 @@ func main() {

var wg sync.WaitGroup
wg.Add(1)
// TODO: can we move these into two separate entrypoint files?
switch cfg.AppType {
case WailsAppType:
err := svc.launchLNBackend()
Expand Down

0 comments on commit 09cc94d

Please sign in to comment.