From 987e75c9cf720e97aea59b458d00312b9b657b23 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 11 Feb 2026 02:16:37 +0000
Subject: [PATCH] =attempt to debug why content_update gets called after upload completes

---
 assets/js/concise/Referral.js |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/assets/js/concise/Referral.js b/assets/js/concise/Referral.js
index 6435e98..14fa979 100644
--- a/assets/js/concise/Referral.js
+++ b/assets/js/concise/Referral.js
@@ -35,7 +35,7 @@
 		};
 
 		this.forms = this.container.querySelectorAll('form');
-		this.popup = new window.jvbPopup({
+		this.popup = window.jvbPopup.registerPopup({
 			toggle: this.toggle,
 			popup: this.container,
 			name: 'Referral Box',
@@ -50,7 +50,7 @@
 		this.tabs = null;
 
 		if (this.container.querySelector('nav.tabs')) {
-			this.tabs = new window.jvbTabs(this.container, {updateURL: false});
+			this.tabs = window.jvbTabs.registerTab(this.container, {updateURL: false});
 		}
 
 
@@ -63,7 +63,6 @@
 				btn.remove();
 			});
 		}
-		this.formController = null;
 	}
 
 	initStore() {
@@ -641,8 +640,9 @@
 					referral_code: formData.get('referral_code')
 				};
 
-				if (formData.get('cf-turnstile-response')) {
-					data['cf-turnstile-response'] = formData.get('cf-turnstile-response');
+				const turnstileInput = form.querySelector('input[name="cf-turnstile-response"]');
+				if (turnstileInput && turnstileInput.value) {
+					data['cf-turnstile-response'] = turnstileInput.value;
 				}
 
 				if (!data.name || !data.email || !data.referral_code) {
@@ -653,18 +653,19 @@
 			} else if (form.id === 'login-form') {
 				let data = {
 					type: 'login',
-					email: formData.get('login_email'),
+					user_email: formData.get('login_email'),
 					context: {
 						redirect_to: window.location.href + '?seeReferral=1'
 					}
 				};
-				if (formData.get('cf-turnstile-response')) {
-					data['cf-turnstile-response'] = formData.get('cf-turnstile-response');
+				const turnstileInput = form.querySelector('input[name="cf-turnstile-response"]');
+				if (turnstileInput && turnstileInput.value) {
+					data['cf-turnstile-response'] = turnstileInput.value;
 				}
-				if (!data.email) {
+				if (!data['user_email']) {
 					result.message = 'Please fill in your email';
 				} else {
-					result = await this.makeRequest('magic', data);
+					result = await this.makeRequest('auth/magic', data);
 				}
 			}
 
@@ -683,7 +684,7 @@
 
 	async makeRequest(endpoint, data) {
 		const validEndpoints = [
-			'magic',
+			'auth/magic',
 			'auth/register'
 		];
 

--
Gitblit v1.10.0