mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 07:46:06 +08:00
Minor fixes
This commit is contained in:
parent
c00cc1c882
commit
036d9f5943
|
@ -42,7 +42,7 @@ class ThreadListParticipants extends React.Component
|
|||
if spacer
|
||||
accumulate('...')
|
||||
else
|
||||
if contact.name.length > 0
|
||||
if contact.name and contact.name.length > 0
|
||||
if items.length > 1
|
||||
short = contact.displayName(includeAccountLabel: false, compact: true)
|
||||
else
|
||||
|
@ -52,6 +52,9 @@ class ThreadListParticipants extends React.Component
|
|||
if idx < items.length-1 and not items[idx+1].spacer
|
||||
short += ", "
|
||||
accumulate(short, unread)
|
||||
|
||||
if not @props.thread.__messages
|
||||
throw new Error("ThreadListParticipants requires __messages.")
|
||||
|
||||
messages = (@props.thread.__messages ? [])
|
||||
if messages.length > 1
|
||||
|
|
|
@ -9,7 +9,7 @@ import SanitizeTransformer from '../../src/services/sanitize-transformer';
|
|||
|
||||
|
||||
xdescribe('DraftHelpers', function describeBlock() {
|
||||
describe('prepareDraftForSyncback', () => {
|
||||
describe('draftPreparedForSyncback', () => {
|
||||
beforeEach(() => {
|
||||
spyOn(Actions, 'queueTask')
|
||||
});
|
||||
|
@ -30,7 +30,7 @@ xdescribe('DraftHelpers', function describeBlock() {
|
|||
spyOn(DraftHelpers, 'removeStaleUploads');
|
||||
|
||||
waitsForPromise(async () => {
|
||||
await DraftHelpers.prepareDraftForSyncback(session);
|
||||
await DraftHelpers.draftPreparedForSyncback(session);
|
||||
expect(session.ensureCorrectAccount).toHaveBeenCalled();
|
||||
expect(DraftHelpers.applyExtensionTransforms).toHaveBeenCalled();
|
||||
expect(DraftHelpers.removeStaleUploads).toHaveBeenCalled();
|
||||
|
|
|
@ -18,7 +18,8 @@ export default class AttributeDateTime extends Attribute {
|
|||
}
|
||||
|
||||
fromJSON(val) {
|
||||
return val ? new Date(val * 1000) : null;
|
||||
if (!val || val instanceof Date) { return val; }
|
||||
return new Date(val * 1000);
|
||||
}
|
||||
|
||||
columnSQL() {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import Task from './task';
|
||||
import Thread from '../models/thread';
|
||||
import Message from '../models/message';
|
||||
|
||||
/*
|
||||
Public: The ChangeMailTask is a base class for all tasks that modify sets
|
||||
|
@ -68,16 +66,7 @@ export default class ChangeMailTask extends Task {
|
|||
return new this.constructor(this);
|
||||
}
|
||||
|
||||
objectIds() {
|
||||
return [].concat(this.threadIds, this.messageIds);
|
||||
}
|
||||
|
||||
objectClass() {
|
||||
return (this.threadIds && this.threadIds.length) ? Thread : Message;
|
||||
}
|
||||
|
||||
numberOfImpactedItems() {
|
||||
return this.objectIds().length;
|
||||
return this.threadIds.length || this.messageIds.length;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ export default class ChangeStarredTask extends ChangeMailTask {
|
|||
if (this.source === "Mail Rules") {
|
||||
return
|
||||
}
|
||||
const eventName = this.unread ? "Starred" : "Unstarred";
|
||||
const eventName = this.starred ? "Starred" : "Unstarred";
|
||||
Actions.recordUserEvent(`Threads ${eventName}`, {
|
||||
source: this.source,
|
||||
numThreads: this.threadIds.length,
|
||||
|
|
Loading…
Reference in a new issue