mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-04 02:15:57 +08:00
Fix a few misc exceptions sent to Sentry
This commit is contained in:
parent
cb02bf1000
commit
3cde64fcd5
6 changed files with 31 additions and 11 deletions
11
.github/workflows/build-macos.yaml
vendored
11
.github/workflows/build-macos.yaml
vendored
|
@ -2,10 +2,9 @@ name: Build for macOS
|
|||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
branches: master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-macos:
|
||||
strategy:
|
||||
matrix:
|
||||
# Confusingly, macos-13 is intel and macos-latest is ARM
|
||||
|
@ -14,8 +13,14 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Fail if branch is not main
|
||||
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master'
|
||||
run: |
|
||||
echo "This workflow should not be triggered with workflow_dispatch on a branch other than main"
|
||||
exit 1
|
||||
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache NodeJS modules
|
||||
uses: actions/cache@v4
|
||||
|
|
|
@ -12,8 +12,6 @@ This is a patch release that resolves several user-reported issues. Thank
|
|||
|
||||
- The RPM build no longer generate build_id links to prevent conflicts when installing multiple Electron apps.
|
||||
|
||||
# versions of electron apps
|
||||
|
||||
## 1.15.0
|
||||
|
||||
Happy 2025! This version of Mailspring upgraedes the app to Electron 33 and Chromium 130, ensuring the latest upstream bug fixes, security patches and improvements are available in the app.
|
||||
|
|
|
@ -75,7 +75,7 @@ class ContactDetailWithFocus extends React.Component<ContactDetailProps, Contact
|
|||
const contact =
|
||||
editing === 'new' && 'accountId' in perspective
|
||||
? emptyContactForAccountId(perspective.accountId)
|
||||
: contacts.find(c => c.id === focusedId);
|
||||
: contacts?.find(c => c.id === focusedId);
|
||||
|
||||
if (!contact) {
|
||||
return { metadata: null, data: null, contact: null };
|
||||
|
|
|
@ -150,7 +150,7 @@ export class TranslateMessageHeader extends React.Component<
|
|||
|
||||
callCldViaExtension(text, (err, result) => {
|
||||
if (err || !result || !result.languages?.length) {
|
||||
console.warn(`Could not detect message language: ${err.toString()}`);
|
||||
console.warn(`Could not detect message language: ${err?.toString()}`);
|
||||
return;
|
||||
}
|
||||
if (!this._mounted) {
|
||||
|
|
|
@ -157,6 +157,10 @@ export default class AppEnvConstructor {
|
|||
if (!originalError && !message) return;
|
||||
if (!originalError) originalError = new Error(`${message}`);
|
||||
|
||||
if (`${originalError}`.toLowerCase().includes('resizeobserver')) {
|
||||
return; // happens infrequently, but errors a zillion times - too noisy for Sentry
|
||||
}
|
||||
|
||||
if (!this.inDevMode()) {
|
||||
return this.reportError(originalError, { url, line, column });
|
||||
}
|
||||
|
@ -403,7 +407,8 @@ export default class AppEnvConstructor {
|
|||
if (process.platform === 'linux') {
|
||||
const dimensions = this.getWindowDimensions();
|
||||
const display =
|
||||
require('@electron/remote').screen.getDisplayMatching(dimensions) || require('@electron/remote').screen.getPrimaryDisplay();
|
||||
require('@electron/remote').screen.getDisplayMatching(dimensions) ||
|
||||
require('@electron/remote').screen.getPrimaryDisplay();
|
||||
const x = display.bounds.x + (display.bounds.width - dimensions.width) / 2;
|
||||
const y = display.bounds.y + (display.bounds.height - dimensions.height) / 2;
|
||||
|
||||
|
@ -781,7 +786,10 @@ export default class AppEnvConstructor {
|
|||
}
|
||||
|
||||
async showOpenDialog(options: Electron.OpenDialogOptions, callback: (paths: string[]) => void) {
|
||||
const result = await require('@electron/remote').dialog.showOpenDialog(this.getCurrentWindow(), options);
|
||||
const result = await require('@electron/remote').dialog.showOpenDialog(
|
||||
this.getCurrentWindow(),
|
||||
options
|
||||
);
|
||||
callback(result.filePaths);
|
||||
}
|
||||
|
||||
|
@ -789,7 +797,10 @@ export default class AppEnvConstructor {
|
|||
if (options.title == null) {
|
||||
options.title = 'Save File';
|
||||
}
|
||||
const result = await require('@electron/remote').dialog.showSaveDialog(this.getCurrentWindow(), options);
|
||||
const result = await require('@electron/remote').dialog.showSaveDialog(
|
||||
this.getCurrentWindow(),
|
||||
options
|
||||
);
|
||||
callback(result.filePath);
|
||||
}
|
||||
|
||||
|
@ -811,7 +822,9 @@ export default class AppEnvConstructor {
|
|||
|
||||
let winToShow = null;
|
||||
if (showInMainWindow) {
|
||||
winToShow = require('@electron/remote').getGlobal('application').getMainWindow();
|
||||
winToShow = require('@electron/remote')
|
||||
.getGlobal('application')
|
||||
.getMainWindow();
|
||||
}
|
||||
|
||||
if (!detail) {
|
||||
|
|
|
@ -465,6 +465,10 @@ export class ImageAttachmentItem extends Component<ImageAttachmentItemProps> {
|
|||
imgEl = parent.querySelector('.file-preview img') as HTMLImageElement,
|
||||
editor = this._editor();
|
||||
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._pData = { x: ev.pageX, y: ev.pageY, eH: editor.clientHeight };
|
||||
this._shiftData.held = ev.shiftKey;
|
||||
this._shiftData.ratio = { wh: imgEl.width / imgEl.height, hw: imgEl.height / imgEl.width };
|
||||
|
|
Loading…
Add table
Reference in a new issue