mirror of
https://github.com/BlowaterNostr/blowater.git
synced 2024-10-18 15:43:20 +00:00
remove unused code (#342)
This commit is contained in:
parent
62dc891d99
commit
253958579e
@ -161,7 +161,7 @@ export class App {
|
||||
profileSyncer.add(args.ctx.publicKey.hex);
|
||||
|
||||
// init conversation list
|
||||
const conversationLists = new DM_List(args.ctx, profileSyncer);
|
||||
const conversationLists = new DM_List(args.ctx);
|
||||
conversationLists.addEvents(Array.from(args.database.getAllEvents()));
|
||||
|
||||
const dmController = new DirectedMessageController(args.ctx);
|
||||
|
@ -2,8 +2,6 @@ import { ConversationListRetriever, NewMessageChecker } from "./conversation-lis
|
||||
import { PublicKey } from "../lib/nostr-ts/key.ts";
|
||||
import { NostrAccountContext, NostrEvent, NostrKind } from "../lib/nostr-ts/nostr.ts";
|
||||
import { getTags, Parsed_Event } from "../nostr.ts";
|
||||
import { ProfileSyncer } from "../features/profile.ts";
|
||||
import { gm_Creation } from "../features/gm.ts";
|
||||
|
||||
export interface ConversationSummary {
|
||||
pubkey: PublicKey;
|
||||
@ -16,7 +14,6 @@ export class DM_List implements ConversationListRetriever, NewMessageChecker {
|
||||
|
||||
constructor(
|
||||
public readonly ctx: NostrAccountContext,
|
||||
private readonly profileSyncer: ProfileSyncer,
|
||||
) {}
|
||||
|
||||
has(hex: string, isGourpChat: boolean): boolean {
|
||||
|
@ -8,7 +8,7 @@ import { emitFunc, EventSubscriber } from "../event-bus.ts";
|
||||
import { SearchUpdate, SelectConversation } from "./search_model.ts";
|
||||
import { PublicKey } from "../lib/nostr-ts/key.ts";
|
||||
import { PinConversation, UnpinConversation } from "../nostr.ts";
|
||||
import { PrimaryTextColor, SecondaryBackgroundColor } from "./style/colors.ts";
|
||||
import { ErrorColor, PrimaryTextColor, SecondaryBackgroundColor } from "./style/colors.ts";
|
||||
import { ButtonGroup } from "./components/button-group.tsx";
|
||||
import { ChatIcon } from "./icons/chat-icon.tsx";
|
||||
import { StartCreateGroupChat } from "./create-group.tsx";
|
||||
@ -102,7 +102,7 @@ export class ConversationList extends Component<Props, State> {
|
||||
for (const conversationSummary of listToRender) {
|
||||
convoListToRender.push({
|
||||
conversation: conversationSummary,
|
||||
isMarked: props.hasNewMessages.has(conversationSummary.pubkey.hex, listToRender == groups),
|
||||
newMessageCount: 0,
|
||||
});
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ export interface PinListGetter {
|
||||
}
|
||||
|
||||
type ConversationListProps = {
|
||||
contacts: { conversation: ConversationSummary; isMarked: boolean }[];
|
||||
contacts: { conversation: ConversationSummary; newMessageCount: number }[];
|
||||
currentSelected: SelectConversation | undefined;
|
||||
pinListGetter: PinListGetter;
|
||||
isGroupChat: boolean;
|
||||
@ -265,7 +265,7 @@ function ContactGroup(props: ConversationListProps) {
|
||||
>
|
||||
<ConversationListItem
|
||||
conversation={contact.conversation}
|
||||
isMarked={contact.isMarked}
|
||||
newMessageCount={contact.newMessageCount}
|
||||
isPinned={true}
|
||||
profile={profile}
|
||||
/>
|
||||
@ -317,7 +317,7 @@ function ContactGroup(props: ConversationListProps) {
|
||||
>
|
||||
<ConversationListItem
|
||||
conversation={contact.conversation}
|
||||
isMarked={contact.isMarked}
|
||||
newMessageCount={contact.newMessageCount}
|
||||
isPinned={false}
|
||||
profile={profile}
|
||||
/>
|
||||
@ -353,7 +353,7 @@ function ContactGroup(props: ConversationListProps) {
|
||||
|
||||
type ListItemProps = {
|
||||
conversation: ConversationSummary;
|
||||
isMarked: boolean;
|
||||
newMessageCount: number;
|
||||
isPinned: boolean;
|
||||
profile: ProfileData | undefined;
|
||||
};
|
||||
@ -384,11 +384,12 @@ function ConversationListItem(props: ListItemProps) {
|
||||
)
|
||||
: undefined}
|
||||
|
||||
{props.isMarked
|
||||
{props.newMessageCount > 0
|
||||
? (
|
||||
<span
|
||||
class={tw`absolute rounded-full h-2 w-2 bottom-2 right-2 bg-[#54D48C]`}
|
||||
class={tw`absolute top-0 right-0 px-1 text-[${PrimaryTextColor}] text-xs rounded-full bg-[${ErrorColor}]`}
|
||||
>
|
||||
{props.newMessageCount}
|
||||
</span>
|
||||
)
|
||||
: undefined}
|
||||
|
Loading…
Reference in New Issue
Block a user