Skip to content

Commit

Permalink
fix of folder creation "already exists" error
Browse files Browse the repository at this point in the history
  • Loading branch information
hazal-karakus committed Oct 29, 2024
1 parent 333a20b commit 866f2cb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
15 changes: 9 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const dir = app.getAppPath();

Sentry.init({
// TODO: Replace with your project's DSN
dsn: '***',
dsn: '****',

beforeSend(event) {
console.log(event.tags.onlineStatus)
if (event.tags.onlineStatus === 'online') {
Expand Down Expand Up @@ -102,10 +102,13 @@ ipcMain.on('online-status-changed', (event, status) => {
if (status === 'offline') {
console.log('OFFLINE')
event.setTag
fs.mkdirSync((`${dir}`, 'offlineEvents'), (err, directory) => {
if (err) throw err;
// A new temporary directory is created within the app root
});
if (!fs.existsSync((`${dir}`, 'offlineEvents'))) {
fs.mkdirSync((`${dir}`, 'offlineEvents'), (err, directory) => {
if (err) throw err;
// A new temporary directory is created within the app root
});
}

Sentry.configureScope(scope => {
scope.setTag("onlineStatus", 'offline');
});
Expand Down
18 changes: 10 additions & 8 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions sentry.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defaults.url=https://sentry.io/
defaults.org=demo
defaults.project=hazal-electron
auth.token=****
defaults.project=electron
auth.token=***
cli.executable=node_modules/@sentry/cli/bin/sentry-cli

0 comments on commit 866f2cb

Please sign in to comment.