Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

Attempt to fix pre selection of main currency

ellite90ac147e2cd8
diff --git a/endpoints/user/save_user.php b/endpoints/user/save_user.php
index e13f086..daaf2ea 100644
--- a/endpoints/user/save_user.php
+++ b/endpoints/user/save_user.php
@@ -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);
}
diff --git a/includes/checksession.php b/includes/checksession.php
index b0f23d0..f7c8610 100644
--- a/includes/checksession.php
+++ b/includes/checksession.php
@@ -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);