fix notifications page on unauthed app (#7226)

This commit is contained in:
jessopb 2021-10-06 10:13:37 -04:00 committed by GitHub
parent 3a644d7bfc
commit 4bc4a965d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 20 deletions

View file

@ -2183,5 +2183,6 @@
"Creator": "Creator", "Creator": "Creator",
"From comments": "From comments", "From comments": "From comments",
"From search": "From search", "From search": "From search",
"Manage tags": "Manage tags",
"--end--": "--end--" "--end--": "--end--"
} }

View file

@ -32,6 +32,7 @@ export default function NotificationSettingsPage(props: Props) {
const lbryIoParams = verificationToken ? { auth_token: verificationToken } : undefined; const lbryIoParams = verificationToken ? { auth_token: verificationToken } : undefined;
React.useEffect(() => { React.useEffect(() => {
if (isAuthenticated) {
Lbryio.call('tag', 'list', lbryIoParams) Lbryio.call('tag', 'list', lbryIoParams)
.then(setTags) .then(setTags)
.catch((e) => { .catch((e) => {
@ -53,7 +54,8 @@ export default function NotificationSettingsPage(props: Props) {
.catch((e) => { .catch((e) => {
setError(true); setError(true);
}); });
}, []); }
}, [isAuthenticated]);
function handleChangeTag(name, newIsEnabled) { function handleChangeTag(name, newIsEnabled) {
const tagParams = newIsEnabled ? { add: name } : { remove: name }; const tagParams = newIsEnabled ? { add: name } : { remove: name };