From 65186eee5fb0b7527f39bf75cf36022d03eb172a Mon Sep 17 00:00:00 2001
From: Bullish Bear <136302410+foodstr@users.noreply.github.com>
Date: Mon, 9 Oct 2023 21:55:44 +0800
Subject: [PATCH] fix EditGroup (#225)
---
UI/app_update.tsx | 2 +-
UI/edit-group.tsx | 15 ++++++++++++---
lib/nostr-ts | 2 +-
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/UI/app_update.tsx b/UI/app_update.tsx
index 7ab20c6..507315b 100644
--- a/UI/app_update.tsx
+++ b/UI/app_update.tsx
@@ -365,7 +365,7 @@ export async function* UI_Interaction_Update(args: {
),
});
diff --git a/UI/edit-group.tsx b/UI/edit-group.tsx
index e97f618..2d457b3 100644
--- a/UI/edit-group.tsx
+++ b/UI/edit-group.tsx
@@ -8,8 +8,8 @@ import { ButtonClass, InputClass, LinearGradientsClass } from "./components/tw.t
import { Avatar } from "./components/avatar.tsx";
import { ProfileData } from "../features/profile.ts";
import { emitFunc } from "../event-bus.ts";
-import { PrivateKey, PublicKey } from "../lib/nostr-ts/key.ts";
-import { ConversationLists } from "./conversation-list.ts";
+import { PublicKey } from "../lib/nostr-ts/key.ts";
+import { ProfileGetter } from "./search.tsx";
export type StartEditGroupChatProfile = {
type: "StartEditGroupChatProfile";
@@ -25,7 +25,7 @@ export type EditGroupChatProfile = {
type Props = {
emit: emitFunc;
publicKey: PublicKey;
- conversationLists: ConversationLists;
+ profileGetter: ProfileGetter;
};
type State = {
@@ -54,6 +54,15 @@ export class EditGroup extends Component {
tw`w-full mt-4 ${ButtonClass} ${LinearGradientsClass} hover:bg-gradient-to-l disabled:opacity-50`,
};
+ componentDidMount() {
+ const profile = this.props.profileGetter.getProfilesByPublicKey(this.props.publicKey);
+
+ this.setState({
+ name: profile?.profile.name || "",
+ picture: profile?.profile.picture || "",
+ });
+ }
+
onNameInput = (name: string) => {
this.setState({
name: name,
diff --git a/lib/nostr-ts b/lib/nostr-ts
index a8a2169..23c6b0b 160000
--- a/lib/nostr-ts
+++ b/lib/nostr-ts
@@ -1 +1 @@
-Subproject commit a8a21694c7f0052af9549485033a8e07d60a786f
+Subproject commit 23c6b0b2a6480cf2234041e48d2b4f882cb67903