[client-app] Allow the packageMigrationManager to re-enable packages

Summary:
Remove packages from the disabled package list when they have been
migrated to be enabled by default.

Also, the last migration would not have worked properly anyways because
the daily channel was already on 1.0.56, and we check for greater-than
rather than equal-to. Bump that version to match the next update.

Test Plan: manual

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D4335
This commit is contained in:
Halla Moore 2017-04-04 11:58:02 -07:00
parent 7d99567855
commit 2b39af5aba

View file

@ -21,7 +21,7 @@ const PACKAGE_MIGRATIONS = [
}],
},
{
"version": "1.0.56",
"version": "2.0.1",
"package-migrations": [
{
"new-name": "thread-snooze",
@ -98,7 +98,12 @@ class PackageMigrationManager {
// If the old install was enabled, keep it that way
if (oldEnabledPackNames.includes(migration['old-name'])) { return }
// If we want to enable the package by default,
if (migration['enabled-by-default']) { return }
if (migration['enabled-by-default']) {
if (disabledPackNames.includes(migration['old-name'])) {
this.config.removeAtKeyPath('core.disabledPackages', migration['old-name'])
}
return
}
const newName = migration['new-name']
this.config.pushAtKeyPath('core.disabledPackages', newName);
})