Fix logged out mutelist

This commit is contained in:
Kieran 2023-08-06 16:03:44 +01:00
parent 325e4be2ef
commit d449c4aa57
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 8 additions and 2 deletions

View File

@ -10,5 +10,11 @@ module.exports = {
commonjs: true,
node: false,
},
"rules": {
"@typescript-eslint/no-non-null-assertion": "error",
"require-await": "error",
"eqeqeq": "error",
"object-shorthand": "warn",
}
};

View File

@ -52,7 +52,7 @@
"scripts": {
"start": "webpack serve",
"build": "webpack --node-env=production",
"deploy": "yarn build && npx wrangler pages publish build",
"deploy": "__XXX='false' && yarn build && npx wrangler pages publish build",
"deploy:xxzap": "__XXX='true' && yarn build && npx wrangler pages publish --project-name xxzap build"
},
"eslintConfig": {

View File

@ -6,7 +6,7 @@ import { MUTED } from "const";
export function useMute(pubkey: string) {
const login = useLogin();
const { tags, content } = login!.muted;
const { tags, content } = login?.muted ?? { tags: [] };
const muted = useMemo(() => tags.filter((t) => t.at(0) === "p"), [tags]);
const isMuted = useMemo(
() => muted.find((t) => t.at(1) === pubkey),