mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 07:46:06 +08:00
In Snap, link to instructions instead of showing check for default client
This commit is contained in:
parent
f0c45d7c4e
commit
2cd2d1ccfb
|
@ -1,17 +1,21 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { DefaultClientHelper, SystemStartService } from 'mailspring-exports';
|
import { DefaultClientHelper, SystemStartService } from 'mailspring-exports';
|
||||||
|
import { shell } from 'electron';
|
||||||
|
|
||||||
import ConfigSchemaItem from './config-schema-item';
|
import ConfigSchemaItem from './config-schema-item';
|
||||||
|
|
||||||
class DefaultMailClientItem extends React.Component {
|
class DefaultMailClientItem extends React.Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.state = { defaultClient: false };
|
|
||||||
this._helper = new DefaultClientHelper();
|
this._helper = new DefaultClientHelper();
|
||||||
if (this._helper.available()) {
|
if (this._helper.available()) {
|
||||||
|
this.state = { defaultClient: false };
|
||||||
this._helper.isRegisteredForURLScheme('mailto', registered => {
|
this._helper.isRegisteredForURLScheme('mailto', registered => {
|
||||||
if (this._mounted) this.setState({ defaultClient: registered });
|
if (this._mounted) this.setState({ defaultClient: registered });
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.state = { defaultClient: 'unknown' };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +39,21 @@ class DefaultMailClientItem extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
if (this.state.defaultClient === 'unknown') {
|
||||||
|
return (
|
||||||
|
<div className="item">
|
||||||
|
<div
|
||||||
|
style={{ marginBottom: 12 }}
|
||||||
|
className="btn btn-small"
|
||||||
|
onClick={() =>
|
||||||
|
shell.openExternal('https://foundry376.zendesk.com/hc/en-us/articles/115002281851')}
|
||||||
|
>
|
||||||
|
Use Mailspring as default mail client
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="item">
|
<div className="item">
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -92,7 +92,7 @@ class Windows {
|
||||||
|
|
||||||
class Linux {
|
class Linux {
|
||||||
available() {
|
available() {
|
||||||
return true;
|
return !process.env.SNAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
isRegisteredForURLScheme(scheme, callback) {
|
isRegisteredForURLScheme(scheme, callback) {
|
||||||
|
|
Loading…
Reference in a new issue