From fcca9259b46bda2d6adf3951b1930fac42fc4f09 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 5 Jan 2024 10:18:44 -0500 Subject: [PATCH] fix: frontend follow logic, as uid is no longer webfinger slug --- public/src/client/account/header.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/src/client/account/header.js b/public/src/client/account/header.js index 9aae8d6a8f..1e4a570b8f 100644 --- a/public/src/client/account/header.js +++ b/public/src/client/account/header.js @@ -108,7 +108,8 @@ define('forum/account/header', [ } function toggleFollow(type) { - api[type === 'follow' ? 'put' : 'del']('/users/' + ajaxify.data.uid + '/follow', undefined, function (err) { + const target = isFinite(ajaxify.data.uid) ? ajaxify.data.uid : encodeURIComponent(ajaxify.data.userslug); + api[type === 'follow' ? 'put' : 'del']('/users/' + target + '/follow', undefined, function (err) { if (err) { return alerts.error(err); }