diff --git a/components/sidebars/SidebarHelp.js b/components/sidebars/SidebarHelp.js index 1bd0cf37..536bf8a7 100644 --- a/components/sidebars/SidebarHelp.js +++ b/components/sidebars/SidebarHelp.js @@ -29,7 +29,7 @@ export default class SidebarHelp extends React.Component { state = { name: this.props.viewer?.name || "", email: "", - twitter: "", + twitter: this.props.viewer.twitterUsername || "", message: "", }; diff --git a/node_common/data/methods/get-user-by-twitter-id.js b/node_common/data/methods/get-user-by-twitter-id.js index 89ab528f..92eab02d 100644 --- a/node_common/data/methods/get-user-by-twitter-id.js +++ b/node_common/data/methods/get-user-by-twitter-id.js @@ -7,7 +7,7 @@ export default async ({ twitterId }) => { return await runQuery({ label: "GET_USER_BY_TWITTER_ID", queryFn: async (DB) => { - let query = await DB.select("*").from("users").where({ twitterId: twitterId }).first(); + let query = await DB.select("*").from("users").where({ twitterId }).first(); if (!query || query.error) { return null; diff --git a/node_common/serializers.js b/node_common/serializers.js index 4351ad01..37276c19 100644 --- a/node_common/serializers.js +++ b/node_common/serializers.js @@ -82,6 +82,8 @@ export const cleanUser = (entity) => { password: entity.password, email: entity.email, twitterId: entity.twitterId, + twitterUsername: entity.twitterUsername, + twitterVerified: entity.twitterVerified, authVersion: entity.authVersion, data: entity.data, body: entity.body, diff --git a/scripts/flattening-migration.js b/scripts/flattening-migration.js index fe4544db..184e1e1a 100644 --- a/scripts/flattening-migration.js +++ b/scripts/flattening-migration.js @@ -274,9 +274,9 @@ Users 'data.settings.settings_deals_auto_approve', -> 'settingsDealsAutoApprove' MIGRATED 'data.settings.allow_automatic_data_storage', -> 'allowAutomaticDataStorage' MIGRATED 'data.settings.allow_encrypted_data_storage', -> 'allowEncryptedDataStorage' MIGRATED - 'data.onboarding', -> 'onboarding' - 'data.twitter.username', -> 'twitterUsername' - 'data.twitter.verified', -> 'twitterVerified' + 'data.onboarding', -> 'onboarding' MIGRATED + 'data.twitter.username', -> 'twitterUsername' MIGRATED + 'data.twitter.verified', -> 'twitterVerified' MIGRATED ] Slates