From 20061b029e6c453ad9f0c158816bdf6ba1143e53 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 17 Jan 2022 14:08:50 +0100 Subject: Fix enable/disable notification text on user profile page. --- server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.js b/server.js index c6c78b5..7ef6b4c 100644 --- a/server.js +++ b/server.js @@ -238,6 +238,7 @@ const SQL_SELECT_USER_INFO = SQL(` const SQL_OFFLINE_USER = SQL("SELECT * FROM user_view NATURAL JOIN user_last_seen WHERE user_id=? AND datetime('now') > datetime(atime,?)"); +const SQL_SELECT_USER_NOTIFY = SQL("SELECT notify FROM users WHERE user_id=?").pluck(); const SQL_UPDATE_USER_NOTIFY = SQL("UPDATE users SET notify=? WHERE user_id=?"); const SQL_UPDATE_USER_NAME = SQL("UPDATE users SET name=? WHERE user_id=?"); const SQL_UPDATE_USER_MAIL = SQL("UPDATE users SET mail=? WHERE user_id=?"); @@ -1048,6 +1049,7 @@ app.get('/games', function (req, res) { app.get('/profile', must_be_logged_in, function (req, res) { LOG(req, "GET /profile"); + req.user.notify = SQL_SELECT_USER_NOTIFY.get(req.user.user_id); let avatar = get_avatar(req.user.mail); let games = QUERY_LIST_GAMES_OF_USER.all({user_id: req.user.user_id}); annotate_games(games, req.user.user_id); -- cgit v1.2.3