From 658b8f3db3953f5b44b6910e322c8c5151e0656c Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Tue, 2 Oct 2018 01:04:57 +0000
Subject: [PATCH] prompt for avatar name before entry if not set

---
 src/assets/stylesheets/profile.scss |  2 +-
 src/hub.js                          |  4 +---
 src/react-components/ui-root.js     | 14 ++++++--------
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/assets/stylesheets/profile.scss b/src/assets/stylesheets/profile.scss
index 5ebac8182..8763dce5e 100644
--- a/src/assets/stylesheets/profile.scss
+++ b/src/assets/stylesheets/profile.scss
@@ -11,7 +11,7 @@
   display: flex;
   pointer-events: auto;
   z-index: 2;
-  background-color: rgba(255, 255, 255, 0.9);
+  background-color: rgba(255, 255, 255, 0.95);
 
   :local(.logo) {
     width: 150px;
diff --git a/src/hub.js b/src/hub.js
index e397164f5..923728476 100644
--- a/src/hub.js
+++ b/src/hub.js
@@ -196,7 +196,6 @@ function mountUI(props = {}) {
   const disableAutoExitOnConcurrentLoad = qsTruthy("allow_multi");
   const forcedVREntryType = qs.get("vr_entry_type");
   const enableScreenSharing = qsTruthy("enable_screen_sharing");
-  const showProfileEntry = !store.state.activity.hasChangedName;
 
   ReactDOM.render(
     <UIRoot
@@ -208,7 +207,6 @@ function mountUI(props = {}) {
         forcedVREntryType,
         enableScreenSharing,
         store,
-        showProfileEntry,
         ...props
       }}
     />,
@@ -298,7 +296,7 @@ document.addEventListener("DOMContentLoaded", () => {
   window.APP.scene = scene;
 
   registerNetworkSchemas();
-  remountUI({ hubChannel, linkChannel, enterScene: entryManager.enterScene, exitScene: entryManager.exitScene });
+  remountUI({ hubChannel, enterScene: entryManager.enterScene, exitScene: entryManager.exitScene });
 
   pollForSupportAvailability(isSupportAvailable => remountUI({ isSupportAvailable }));
 
diff --git a/src/react-components/ui-root.js b/src/react-components/ui-root.js
index e08bad5d3..f8b6f7545 100644
--- a/src/react-components/ui-root.js
+++ b/src/react-components/ui-root.js
@@ -74,7 +74,6 @@ class UIRoot extends Component {
     scene: PropTypes.object,
     hubChannel: PropTypes.object,
     hubEntryCode: PropTypes.number,
-    showProfileEntry: PropTypes.bool,
     availableVREntryTypes: PropTypes.object,
     environmentSceneLoaded: PropTypes.bool,
     roomUnavailableReason: PropTypes.string,
@@ -120,11 +119,6 @@ class UIRoot extends Component {
     showProfileEntry: false
   };
 
-  constructor(props) {
-    super(props);
-    this.state.showProfileEntry = this.props.showProfileEntry;
-  }
-
   componentDidMount() {
     this.props.concurrentLoadDetector.addEventListener("concurrentload", this.onConcurrentLoad);
     this.micLevelMovingAverage = MovingAverage(100);
@@ -139,8 +133,6 @@ class UIRoot extends Component {
     this.props.scene.removeEventListener("exit", this.exit);
   }
 
-  componentDidUpdate(prevProps) {}
-
   onSceneLoaded = () => {
     this.setState({ sceneLoaded: true });
   };
@@ -170,6 +162,12 @@ class UIRoot extends Component {
   };
 
   handleStartEntry = () => {
+    const promptForNameAndAvatarBeforeEntry = !this.props.store.state.activity.hasChangedName;
+
+    if (promptForNameAndAvatarBeforeEntry) {
+      this.setState({ showProfileEntry: true });
+    }
+
     if (!this.props.forcedVREntryType) {
       this.setState({ entryStep: ENTRY_STEPS.device });
     } else if (this.props.forcedVREntryType.startsWith("daydream")) {
-- 
GitLab