mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 00:06:06 +08:00
Change firstSyncCompletedAt to firstSyncCompletion, now explicitly 14 bytes.
This commit is contained in:
parent
0860f3027c
commit
04ab0d9034
|
@ -22,7 +22,7 @@ function jsonSchema(modelName) {
|
|||
// connection_settings: Joi.object(),
|
||||
// sync_policy: Joi.object(),
|
||||
// sync_error: Joi.object().allow(null),
|
||||
// first_sync_completed_at: Joi.number().allow(null),
|
||||
// first_sync_completion: Joi.number().allow(null),
|
||||
// last_sync_completions: Joi.array(),
|
||||
// })
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ module.exports = (sequelize, Sequelize) => {
|
|||
connectionCredentials: Sequelize.TEXT,
|
||||
syncPolicy: JSONType('syncPolicy'),
|
||||
syncError: JSONType('syncError', {defaultValue: null}),
|
||||
firstSyncCompletedAt: Sequelize.INTEGER,
|
||||
firstSyncCompletion: Sequelize.INTEGER(14),
|
||||
lastSyncCompletions: JSONARRAYType('lastSyncCompletions'),
|
||||
}, {
|
||||
classMethods: {
|
||||
|
@ -31,7 +31,7 @@ module.exports = (sequelize, Sequelize) => {
|
|||
connection_settings: this.connectionSettings,
|
||||
sync_policy: this.syncPolicy,
|
||||
sync_error: this.syncError,
|
||||
first_sync_completed_at: this.firstSyncCompletedAt,
|
||||
first_sync_completion: this.firstSyncCompletion,
|
||||
last_sync_completions: this.lastSyncCompletions,
|
||||
created_at: this.createdAt,
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ class Account extends React.Component {
|
|||
const timeSinceLastSync = (Date.now() - newestSync) / 1000;
|
||||
|
||||
let firstSyncDuration = "Incomplete";
|
||||
if (account.first_sync_completed_at) {
|
||||
firstSyncDuration = (new Date(account.first_sync_completed_at) - new Date(account.created_at)) / 1000;
|
||||
if (account.first_sync_completion) {
|
||||
firstSyncDuration = (new Date(account.first_sync_completion) - new Date(account.created_at)) / 1000;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -197,8 +197,8 @@ class SyncWorker {
|
|||
onSyncDidComplete() {
|
||||
const {afterSync} = this._account.syncPolicy;
|
||||
|
||||
if (!this._account.firstSyncCompletedAt) {
|
||||
this._account.firstSyncCompletedAt = Date.now()
|
||||
if (!this._account.firstSyncCompletion) {
|
||||
this._account.firstSyncCompletion = Date.now()
|
||||
}
|
||||
|
||||
const now = Date.now();
|
||||
|
|
Loading…
Reference in a new issue