diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 32b02eb23..3192bad97 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -456,7 +456,8 @@ define([ edPublic: store.proxy.edPublic, friends: store.proxy.friends || {}, settings: store.proxy.settings, - thumbnails: disableThumbnails === false + thumbnails: disableThumbnails === false, + isDriveOwned: Boolean(Util.find(store, ['driveMetadata', 'owners'])) } }; cb(JSON.parse(JSON.stringify(metadata))); @@ -1523,8 +1524,9 @@ define([ if (!data.userHash) { returned.anonHash = Hash.getEditHashFromKeys(secret); } - }).on('ready', function () { + }).on('ready', function (info) { if (store.userObject) { return; } // the store is already ready, it is a reconnection + store.driveMetadata = info.metadata; if (!rt.proxy.drive || typeof(rt.proxy.drive) !== 'object') { rt.proxy.drive = {}; } var drive = rt.proxy.drive; // Creating a new anon drive: import anon pads from localStorage diff --git a/www/common/translations/messages.js b/www/common/translations/messages.js index 10b7ff4fd..b84e42606 100644 --- a/www/common/translations/messages.js +++ b/www/common/translations/messages.js @@ -667,6 +667,7 @@ define(function () { out.settings_ownDriveHint = "Migrating your drive to the new version will give you access to new features..."; // XXX out.settings_ownDriveButton = "Migrate"; // XXX out.settings_ownDriveConfirm = "Are you sure?"; // XXX + out.settings_ownDrivePending = "Your account is being migrated. Please do not close or reload this page until the process has completed."; // XXX out.settings_changePasswordTitle = "Change your password"; out.settings_changePasswordHint = "Change your account's password. Enter your current password, and confirm the new password by typing it twice.
" + diff --git a/www/settings/app-settings.less b/www/settings/app-settings.less index 9c7bf0a7f..0c21bfed0 100644 --- a/www/settings/app-settings.less +++ b/www/settings/app-settings.less @@ -154,7 +154,7 @@ } } - .cp-settings-change-password { + .cp-settings-change-password, .cp-settings-migrate { [type="password"], [type="text"] { width: @sidebar_button-width; flex: unset; diff --git a/www/settings/inner.js b/www/settings/inner.js index 321a85263..9537a990c 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -52,6 +52,7 @@ define([ 'cp-settings-autostore', 'cp-settings-userfeedback', 'cp-settings-change-password', + 'cp-settings-migrate', 'cp-settings-backup', 'cp-settings-delete' ], @@ -473,10 +474,7 @@ define([ }; create['migrate'] = function () { - if (true) { return; } // STUBBED until we have a reason to deploy this - // TODO - // if (!loginBlock) { return; } - // if (alreadyMigrated) { return; } + if (privateData.isDriveOwned) { return; } if (!common.isLoggedIn()) { return; } var $div = $('
', { 'class': 'cp-settings-migrate cp-sidebarlayout-element'}); @@ -489,25 +487,49 @@ define([ var $ok = $('', {'class': 'fa fa-check', title: Messages.saved}); var $spinner = $('', {'class': 'fa fa-spinner fa-pulse'}); - var $button = $('