mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-24 16:14:01 +08:00
Fix issue with unnamed files causing “click to download inline image” prompt #262
This commit is contained in:
parent
d4211d1a69
commit
5cbf7e31e5
4 changed files with 23 additions and 14 deletions
|
@ -73,16 +73,20 @@
|
||||||
.inner {
|
.inner {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: @background-primary;
|
background: @background-primary;
|
||||||
border-bottom: 1px solid @border-color-divider;
|
border-bottom: 1px solid @border-color-divider;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar-section {
|
.toolbar-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
flex-shrink: 0;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,20 +44,22 @@ export default class ComposerEditorToolbar extends React.Component {
|
||||||
const { value, onChange, plugins } = this.props;
|
const { value, onChange, plugins } = this.props;
|
||||||
const sections = [];
|
const sections = [];
|
||||||
|
|
||||||
plugins.forEach(({ toolbarComponents, toolbarSectionClass }, idx) => {
|
const pluginsWithToolbars = plugins.filter(
|
||||||
if (toolbarComponents && toolbarComponents.length) {
|
(p, idx) => p.toolbarComponents && p.toolbarComponents.length
|
||||||
const sectionItems = toolbarComponents.map((Component, cdx) => (
|
);
|
||||||
<Component key={`${idx}-${cdx}`} value={value} onChange={onChange} />
|
|
||||||
));
|
pluginsWithToolbars.forEach(({ toolbarComponents, toolbarSectionClass }, idx) => {
|
||||||
if (sections.length) {
|
const sectionItems = toolbarComponents.map((Component, cdx) => (
|
||||||
sectionItems.unshift(<div key={idx} className="divider" />);
|
<Component key={`${idx}-${cdx}`} value={value} onChange={onChange} />
|
||||||
}
|
));
|
||||||
sections.push(
|
if (idx < pluginsWithToolbars.length - 1) {
|
||||||
<div key={idx} className={`toolbar-section ${toolbarSectionClass || ''}`}>
|
sectionItems.push(<div key="divider" className="divider" />);
|
||||||
{sectionItems}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
sections.push(
|
||||||
|
<div key={idx} className={`toolbar-section ${toolbarSectionClass || ''}`}>
|
||||||
|
{sectionItems}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -46,6 +46,9 @@ export default class File extends Model {
|
||||||
// name if one is present, and falls back to appropriate default name based on
|
// name if one is present, and falls back to appropriate default name based on
|
||||||
// the contentType. It will always return a non-empty string.
|
// the contentType. It will always return a non-empty string.
|
||||||
displayName() {
|
displayName() {
|
||||||
|
// BG: This logic has been moved to the sync side - all files should always have names
|
||||||
|
// as of the 1.1 release. This is just here still because people's local dbs could
|
||||||
|
// still contain unnammed files.
|
||||||
const defaultNames = {
|
const defaultNames = {
|
||||||
'text/calendar': 'Event.ics',
|
'text/calendar': 'Event.ics',
|
||||||
'image/png': 'Unnamed Image.png',
|
'image/png': 'Unnamed Image.png',
|
||||||
|
|
2
mailsync
2
mailsync
|
@ -1 +1 @@
|
||||||
Subproject commit bfda4b1b9a62896fb89c84c8bf50a83c688a6f47
|
Subproject commit 91d6d6d75f65dc6bcac0aa276c54858c06ca1885
|
Loading…
Reference in a new issue