Skip to content

Commit

Permalink
Added sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
rsathishtechit committed Jun 21, 2023
1 parent ecdd8ab commit f9a4ce6
Show file tree
Hide file tree
Showing 5 changed files with 304 additions and 17 deletions.
268 changes: 268 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "udeler-pro",
"productName": "udeler-pro",
"version": "2.0.0",
"version": "1.0.0",
"description": "Udemy desktop client to download courses",
"main": ".webpack/main",
"scripts": {
Expand Down Expand Up @@ -50,6 +50,8 @@
"@electron/asar": "^3.2.4",
"@headlessui/react": "^1.7.14",
"@heroicons/react": "^2.0.17",
"@sentry/electron": "^4.6.0",
"@sentry/react": "^7.56.0",
"electron-squirrel-startup": "^1.0.0",
"mkdirp": "^3.0.1",
"mt-files-downloader": "github:FaisalUmair/mt-files-downloader-wrapper",
Expand Down
40 changes: 24 additions & 16 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ const { getRxStorageIpcRenderer } = require("rxdb/plugins/electron");

const { ipcRenderer } = require("electron");

import * as Sentry from "@sentry/react";

function FallbackComponent() {
return <div>An error has ocurred :</div>;
}

const App = () => {
const [token, setToken] = React.useState("");
const [url, setURL] = React.useState("");
Expand All @@ -39,22 +45,24 @@ const App = () => {

return (
<>
{db && (
<UdemyContext.Provider value={{ token, setToken, url, setURL }}>
<DbContext.Provider value={{ db, setDb }}>
<DefaultSettingsContext.Provider
value={{ defaultSettings, setDefaultSettings }}
>
<HashRouter>
<Routes>
<Route path="/" element={<Login />} />
<Route path="/dashboard" element={<Dashboard />} />
</Routes>
</HashRouter>
</DefaultSettingsContext.Provider>
</DbContext.Provider>
</UdemyContext.Provider>
)}
<Sentry.ErrorBoundary fallback={FallbackComponent} showDialog>
{db && (
<UdemyContext.Provider value={{ token, setToken, url, setURL }}>
<DbContext.Provider value={{ db, setDb }}>
<DefaultSettingsContext.Provider
value={{ defaultSettings, setDefaultSettings }}
>
<HashRouter>
<Routes>
<Route path="/" element={<Login />} />
<Route path="/dashboard" element={<Dashboard />} />
</Routes>
</HashRouter>
</DefaultSettingsContext.Provider>
</DbContext.Provider>
</UdemyContext.Provider>
)}
</Sentry.ErrorBoundary>
</>
);
};
Expand Down
6 changes: 6 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ const { dialog } = require("electron");
import { join } from "path";
const { homedir } = require("os");

import * as Sentry from "@sentry/electron";

Sentry.init({
dsn: "https://6665e2d7b9174976b95b33e4ab69c2a2@o4505397808660480.ingest.sentry.io/4505397811740672",
});

// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (require("electron-squirrel-startup")) {
app.quit();
Expand Down
Loading

0 comments on commit f9a4ce6

Please sign in to comment.