Skip to content

Commit

Permalink
fix: fix video resize error
Browse files Browse the repository at this point in the history
And ignore the error reported by Sentry.

closes #74
  • Loading branch information
juancarlosfarah committed May 6, 2019
1 parent 3f3fbea commit 499bbc9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/components/phase/PhaseVideo.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.VideoDiv {
display: flex;
justify-content: center;
}
.Video {
width: 100%;
}
8 changes: 3 additions & 5 deletions src/components/phase/PhaseVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ const PhaseVideo = ({ url, asset, name, mimeType }) => {
uri = `file://${asset}`;
}
return (
<div className="VideoDiv">
<video title={name} className="Video" controls>
<source src={uri} type={mimeType} />
</video>
</div>
<video title={name} className="Video" controls>
<source src={uri} type={mimeType} />
</video>
);
};

Expand Down
3 changes: 3 additions & 0 deletions src/config/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ const ERROR_SPACE_ALREADY_AVAILABLE = 'ERROR_SPACE_ALREADY_AVAILABLE';
const ERROR_DOWNLOADING_FILE = 'ERROR_DOWNLOADING_FILE';
const ERROR_GENERAL = 'ERROR_GENERAL';

const WHITELISTED_ERRORS = ['ResizeObserver loop limit exceeded'];

module.exports = {
ERROR_ZIP_CORRUPTED,
ERROR_JSON_CORRUPTED,
ERROR_SPACE_ALREADY_AVAILABLE,
ERROR_DOWNLOADING_FILE,
ERROR_GENERAL,
WHITELISTED_ERRORS,
};
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ReactDOM from 'react-dom';
import './index.css';
import { Provider } from 'react-redux';
import * as Sentry from '@sentry/browser';
import { WHITELISTED_ERRORS } from './config/errors';
import 'react-redux-toastr/lib/css/react-redux-toastr.min.css';
import App from './App';
import configureStore from './store/configure';
Expand All @@ -16,6 +17,7 @@ ReactGa.initialize(REACT_APP_GOOGLE_ANALYTICS_ID);
// set up sentry
Sentry.init({
dsn: REACT_APP_SENTRY_DSN,
ignoreErrors: WHITELISTED_ERRORS,
beforeSend(event) {
// check if it is an exception, and if so, show the report dialog
if (event.exception) {
Expand Down

0 comments on commit 499bbc9

Please sign in to comment.