🪻 distributed transcription service thistle.dunkirk.sh

chore: remove settings button on homepage and make it redirct to auth when logged out

dunkirk.sh 6bde6424 9ab4aadd

verified
Changed files
+21 -2
src
components
pages
+8
src/components/auth.ts
···
}
}
+
public isAuthenticated(): boolean {
+
return this.user !== null;
+
}
+
+
public openAuthModal() {
+
this.openModal();
+
}
+
private openModal() {
this.showModal = true;
this.needsRegistration = false;
+13 -2
src/pages/index.html
···
<p class="hero-subtitle">AI-powered audio transcription made simple</p>
<div class="cta-buttons">
-
<a href="/transcribe" class="btn btn-primary">Start Transcribing</a>
-
<a href="/settings" class="btn btn-secondary">Settings</a>
+
<button id="start-btn" class="btn btn-primary">Start Transcribing</button>
</div>
</main>
<script type="module" src="../components/auth.ts"></script>
+
<script type="module">
+
document.getElementById('start-btn').addEventListener('click', async () => {
+
const authComponent = document.querySelector('auth-component');
+
const isLoggedIn = await authComponent.isAuthenticated();
+
+
if (isLoggedIn) {
+
window.location.href = '/transcribe';
+
} else {
+
authComponent.openAuthModal();
+
}
+
});
+
</script>
</body>
</html>