feat: mute/unmute on profile

This commit is contained in:
2023-07-30 11:07:22 +02:00
parent 249de1d9be
commit 811b1ceaec
7 changed files with 93 additions and 10 deletions

View File

@ -12,6 +12,7 @@ export enum LoginType {
interface ReplaceableTags {
tags: Array<string[]>;
content: "";
timestamp: number;
}
@ -72,11 +73,12 @@ export class LoginStore extends ExternalStore<LoginSession | undefined> {
return this.#session ? { ...this.#session } : undefined;
}
setFollows(follows: Array<string>, ts: number) {
setFollows(follows: Array<string>, content: string, ts: number) {
if (this.#session.follows.timestamp >= ts) {
return;
}
this.#session.follows.tags = follows;
this.#session.follows.content = content;
this.#session.follows.timestamp = ts;
this.#save();
}
@ -86,11 +88,12 @@ export class LoginStore extends ExternalStore<LoginSession | undefined> {
this.#save();
}
setMuted(muted: Array<string[]>, ts: number) {
setMuted(muted: Array<string[]>, content: string, ts: number) {
if (this.#session.muted.timestamp >= ts) {
return;
}
this.#session.muted.tags = muted;
this.#session.muted.content = content;
this.#session.muted.timestamp = ts;
this.#save();
}