converted user.hidePrivacyAlert -> user.onboarding.hidePrivacyAlert

This commit is contained in:
Martina 2021-09-07 12:53:06 -07:00
parent 05b12828ef
commit 18396439ef
4 changed files with 5 additions and 8 deletions

View File

@ -132,11 +132,11 @@ export class Alert extends React.Component {
};
_handleDismissPrivacyAlert = (e) => {
Actions.updateViewer({ hidePrivacyAlert: true });
Actions.updateStatus({ onboarding: ["hidePrivacyAlert"] });
this.props.onAction({
type: "UDPATE_VIEWER",
viewer: {
hidePrivacyAlert: true,
onboarding: { ...this.props.viewer.onboarding, hidePrivacyAlert: true },
},
});
};

View File

@ -278,7 +278,7 @@ export default class ApplicationLayout extends React.Component {
this.props.page?.id === "NAV_SIGN_IN"
? true
: this.props.viewer
? this.props.viewer.hidePrivacyAlert
? this.props.viewer.onboarding.hidePrivacyAlert
: false
}
fileLoading={this.props.fileLoading}

View File

@ -118,7 +118,6 @@ const addUserColumns = async () => {
table.string("name").nullable();
table.string("twitterUsername").nullable();
table.boolean("twitterVerified").notNullable().defaultTo(false);
table.boolean("hidePrivacyAlert").notNullable().defaultTo(false);
table.string("textileToken").nullable();
table.boolean("settingsDealsAutoApprove").notNullable().defaultTo(false);
table.boolean("allowAutomaticDataStorage").notNullable().defaultTo(true);
@ -172,12 +171,11 @@ const migrateUserTable = async () => {
name: data.name,
body: data.body,
photo: data.photo,
hidePrivacyAlert: data.status?.hidePrivacyAlert,
textileToken: data.tokens?.api,
settingsDealsAutoApprove: data.settings?.settings_deals_auto_approve,
allowAutomaticDataStorage: data.settings?.allow_automatic_data_storage,
allowEncryptedDataStorage: data.settings?.allow_encrypted_data_storage,
onboarding: data.onboarding,
onboarding: { ...data.onboarding, hidePrivacyAlert: data.status?.hidePrivacyAlert },
twitterUsername: data.twitter?.username,
twitterVerified: data.twitter?.verified,
};
@ -289,7 +287,7 @@ Users
'data.name', -> 'name' MIGRATED
'data.body', -> 'body' MIGRATED
'data.photo', -> 'photo' MIGRATED
'data.status', -> 'hidePrivacyAlert' MIGRATED
'data.status', -> 'onboarding.hidePrivacyAlert' MIGRATED
'data.tokens.api', -> 'textileToken' MIGRATED
'data.settings.settings_deals_auto_approve', -> 'settingsDealsAutoApprove' MIGRATED
'data.settings.allow_automatic_data_storage', -> 'allowAutomaticDataStorage' MIGRATED

View File

@ -39,7 +39,6 @@ const createUsersTable = db.schema.createTable("users", function (table) {
table.string("twitterId").unique().nullable();
table.string("twitterUsername").nullable();
table.boolean("twitterVerified").notNullable().defaultTo(false);
table.boolean("hidePrivacyAlert").notNullable().defaultTo(false);
table.string("textileToken").nullable();
table.boolean("settingsDealsAutoApprove").notNullable().defaultTo(false);
table.boolean("allowAutomaticDataStorage").notNullable().defaultTo(true);