coderuday21 commited on
Commit
c6682be
·
1 Parent(s): 56c5fcc

UX: show detection-type menu after login before redirect

Browse files
Files changed (2) hide show
  1. static/js/app.js +6 -8
  2. templates/index.html +1 -1
static/js/app.js CHANGED
@@ -162,15 +162,13 @@ async function init() {
162
  try {
163
  const user = await api('GET', '/api/me');
164
  document.getElementById('user-email').textContent = user.email;
 
 
 
 
165
  const preferred = getDetectionTypeFromPath();
166
- if (preferred) {
167
- applyDetectionTypeToUI(preferred);
168
- showView('dashboard');
169
- loadHistory();
170
- } else {
171
- // After login, landing on "/" shows a selection screen.
172
- showView('detection-type');
173
- }
174
  } catch (_) { setToken(null); showView('login'); }
175
  }
176
 
 
162
  try {
163
  const user = await api('GET', '/api/me');
164
  document.getElementById('user-email').textContent = user.email;
165
+ // Always show the selection menu first.
166
+ // If the user already landed on /detect/change or /detect/landslide, we
167
+ // pre-select the corresponding detection type in the dropdown for convenience,
168
+ // but we still show the menu page before redirecting.
169
  const preferred = getDetectionTypeFromPath();
170
+ if (preferred) applyDetectionTypeToUI(preferred);
171
+ showView('detection-type');
 
 
 
 
 
 
172
  } catch (_) { setToken(null); showView('login'); }
173
  }
174
 
templates/index.html CHANGED
@@ -392,6 +392,6 @@
392
  </div>
393
  </div>
394
 
395
- <script src="/static/js/app.js?v=26"></script>
396
  </body>
397
  </html>
 
392
  </div>
393
  </div>
394
 
395
+ <script src="/static/js/app.js?v=27"></script>
396
  </body>
397
  </html>