Merge pull request 'main' (#32) from React-Group/interstellar_ai:main into main

Reviewed-on: https://interstellardevelopment.org/code/code/sageTheDm/interstellar_ai/pulls/32
This commit is contained in:
Patrick 2024-10-02 09:11:17 +02:00
commit d1ccd53f2a

View file

@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import {
createAccount,
checkCredentials,
getData
} from '../backend/database';
import Settings from './settings/Settings'; // Import the Settings component
@ -54,6 +55,10 @@ const Login: React.FC = () => {
const success = await checkCredentials(accountName, password);
if (success) {
setIsLoggedIn(true); // Successful login
var data = await getData(accountName, password)
if (data) {
localStorage.setItem("dataFromServer", data)
}
setShowLoginPopup(false); // Close the login popup
} else {
alert('Incorrect credentials');