Attempt to fix pre selection of main currency

This commit is contained in:
ellite 2023-11-11 22:49:51 +01:00
parent 8cc8a5d501
commit 90ac147e2c
2 changed files with 2 additions and 1 deletions

View File

@ -129,9 +129,9 @@
}
}
$_SESSION['avatar'] = $avatar;
$_SESSION['main_currency'] = $main_currency;
if ($main_currency != $mainCurrencyId) {
$_SESSION['main_currency'] = $main_currency;
update_exchange_rate($db);
}

View File

@ -2,6 +2,7 @@
session_start();
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
$username = $_SESSION['username'];
$main_currency = $_SESSION['main_currency'];
$sql = "SELECT * FROM user WHERE username = :username";
$stmt = $db->prepare($sql);
$stmt->bindValue(':username', $username, SQLITE3_TEXT);