Skip to content

Commit

Permalink
chore: remove outdated crash reporting + remove donate dialog (#638)
Browse files Browse the repository at this point in the history
* chore: remove crash reporting

* chore: update donate dialog function

* feat: remove donate dialog

Co-authored-by: oguhpereira <[email protected]>
  • Loading branch information
dubisdev and ogustavo-pereira authored Dec 28, 2022
1 parent 0325364 commit 3260eed
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 90 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ If you'd like to install a version of Cerebro, but the executable hasn't been re

1. Clone the repository
2. Install dependencies with [yarn](https://yarnpkg.com/getting-started/install):

```bash
yarn --force
```

3. Build the package:

```bash
yarn package
```
Expand Down
6 changes: 3 additions & 3 deletions app/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ const schema = {
cleanOnHide: { type: 'boolean', default: true },
selectOnShow: { type: 'boolean', default: false },
hideOnBlur: { type: 'boolean', default: true },
skipDonateDialog: { type: 'boolean', default: false },
lastShownDonateDialog: { type: 'number', default: 0 },
plugins: { type: 'object', default: {} },
isMigratedPlugins: { type: 'boolean', default: false },
crashreportingEnabled: { type: 'boolean', default: true },
openAtLogin: { type: 'boolean', default: true },
winPosition: { type: 'array', default: [] },
}
Expand All @@ -28,6 +25,9 @@ const store = new Store({
migrations: {
'>=0.9.0': (oldStore) => {
oldStore.delete('positions')
},
'>=0.10.0': (oldStore) => {
oldStore.delete('crashreportingEnabled')
}
}
})
Expand Down
17 changes: 1 addition & 16 deletions app/main.development.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, ipcMain, crashReporter } from 'electron'
import { app, ipcMain } from 'electron'
import path from 'path'

import createMainWindow from './main/createWindow'
Expand All @@ -22,21 +22,6 @@ let mainWindow
let backgroundWindow
let tray

if (process.env.NODE_ENV !== 'development') {
// Set up crash reporter before creating windows in production builds
if (config.get('crashreportingEnabled')) {
crashReporter.start({
globalExtra: {
_companyName: 'Cerebro',
},
productName: 'Cerebro',
submitURL: 'http://crashes.cerebroapp.com/post',
autoSubmit: true,
compress: false
})
}
}

const setupEnvVariables = () => {
process.env.CEREBRO_VERSION = app.getVersion()

Expand Down
5 changes: 0 additions & 5 deletions app/main/createWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
import buildMenu from './createWindow/buildMenu'
import toggleWindow from './createWindow/toggleWindow'
import handleUrl from './createWindow/handleUrl'
import * as donateDialog from './createWindow/donateDialog'

export default ({ src, isDev }) => {
const [x, y] = config.get('winPosition')
Expand Down Expand Up @@ -169,10 +168,6 @@ export default ({ src, isDev }) => {
})
}

if (donateDialog.shouldShow()) {
setTimeout(donateDialog.show, 1000)
}

// Save in config information, that application has been started
config.set('firstStart', false)

Expand Down
5 changes: 0 additions & 5 deletions app/main/createWindow/AppTray.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Menu, Tray, app } from 'electron'
import showWindowWithTerm from './showWindowWithTerm'
import toggleWindow from './toggleWindow'
import checkForUpdates from './checkForUpdates'
import { donate } from './donateDialog'

/**
* Class that controls state of icon in menu bar
Expand Down Expand Up @@ -61,10 +60,6 @@ export default class AppTray {
click: checkForUpdates,
},
separator,
{
label: 'Donate...',
click: donate
}
]

if (isDev) {
Expand Down
55 changes: 0 additions & 55 deletions app/main/createWindow/donateDialog.js

This file was deleted.

6 changes: 0 additions & 6 deletions app/plugins/core/settings/Settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function Settings({ get, set }) {
cleanOnHide: get('cleanOnHide'),
selectOnShow: get('selectOnShow'),
pluginsSettings: get('plugins'),
crashreportingEnabled: get('crashreportingEnabled'),
openAtLogin: get('openAtLogin')
}))

Expand Down Expand Up @@ -83,11 +82,6 @@ function Settings({ get, set }) {
value={state.selectOnShow}
onChange={(value) => changeConfig('selectOnShow', value)}
/>
<Checkbox
label="Send automatic crash reports (requires restart)"
value={state.crashreportingEnabled}
onChange={(value) => changeConfig('crashreportingEnabled', value)}
/>
</div>
)
}
Expand Down

0 comments on commit 3260eed

Please sign in to comment.