* chore: upgrade minor versions
* chore: upgrade cypress
* chore: upgrade fe dependencies
* update readme
* update osx images
* update readme
* upgrade dependencies
* upgrade test dependency
* feat: add option to input autofill
* feat: autofill to the left
* chore: update docs
* chore: cleanup ci
* version bump
* style: prevent zero height bar
* fix: prevent loosing menu
* ux: improve input, no spellcheck or autocomplete
* small ux improvements in cuesheets
* feat 111/increase maximum number of events
* fix: optimistic delete issue with filter
* refact: pincode workflow
* chore: add versioning to packages
This commit is contained in:
Carlos Valente
2022-05-19 10:48:56 +02:00
committed by GitHub
parent 45ac44b2e8
commit 6ac963684d
155 changed files with 3481 additions and 3465 deletions
@@ -2,6 +2,7 @@
import React from 'react';
import { LoggingContext } from '../../../app/context/LoggingContext';
import style from './ErrorBoundary.module.scss';
const appVersion = require('../../../../package.json').version;
class ErrorBoundary extends React.Component {
static contextType = LoggingContext;
@@ -22,7 +23,11 @@ class ErrorBoundary extends React.Component {
error: error,
errorInfo: info,
});
this.context.emitError(error.toString());
try {
this.context.emitError(error.toString());
} catch {
console.log('Unable to emit error')
}
this.reportContent = `${error} ${info.componentStack}`;
}
@@ -35,10 +40,27 @@ class ErrorBoundary extends React.Component {
<p>Something went wrong</p>
<p
className={style.report}
onClick={() => navigator.clipboard.writeText(this.reportContent)}
onClick={() => {
if (navigator.clipboard) {
const copyContent = `ontime version ${appVersion} \n ${this.reportContent}`;
navigator.clipboard.writeText(copyContent);
}
}}
>
Copy error
</p>
<p
className={style.report}
onClick={() => {
if (window.process.type === 'renderer') {
window.ipcRenderer.send('reload');
} else {
window.location.reload();
}
}}
>
Reload interface
</p>
</div>
</div>
);