diff --git a/src/lib/adapters/index.ts b/src/lib/adapters/index.ts index c12b2c12..fe6ee516 100644 --- a/src/lib/adapters/index.ts +++ b/src/lib/adapters/index.ts @@ -13,6 +13,7 @@ export interface Adapter { startChat(address: string, peerAddress: string): Promise startGroupChat( wallet: BaseWallet, + chatId: string, memberAddresses: string[], name: string, avatar?: string, diff --git a/src/lib/adapters/waku/index.ts b/src/lib/adapters/waku/index.ts index 5cdd192a..06030fe0 100644 --- a/src/lib/adapters/waku/index.ts +++ b/src/lib/adapters/waku/index.ts @@ -33,7 +33,6 @@ import { makeWakuObjectAdapter } from '$lib/objects/adapter' import { fetchBalances } from '$lib/adapters/balance' import { makeWakustore } from './wakustore' import type { StorageChat, StorageChatEntry, StorageObjectEntry, StorageProfile } from './types' -import { genRandomHex } from '$lib/utils' import { walletStore } from '$lib/stores/wallet' import { SafeWaku } from './safe-waku' @@ -280,6 +279,7 @@ export default class WakuAdapter implements Adapter { async startGroupChat( wallet: BaseWallet, + chatId: string, memberAddresses: string[], name: string, avatar?: string, @@ -288,8 +288,6 @@ export default class WakuAdapter implements Adapter { throw 'invalid chat' } - const chatId = genRandomHex(64) - const userAddresses = [...memberAddresses, wallet.address] const storageChat = { users: userAddresses, diff --git a/src/lib/components/avatar.svelte b/src/lib/components/avatar.svelte index 84632922..e7af5ac2 100644 --- a/src/lib/components/avatar.svelte +++ b/src/lib/components/avatar.svelte @@ -1,11 +1,12 @@
{#if picture} profile - {:else} - + {:else if seed} + {@const style = group ? 'shapes' : 'bottts-neutral'} + {/if}
diff --git a/src/lib/components/dicebear.svelte b/src/lib/components/dicebear.svelte new file mode 100644 index 00000000..a90bf27b --- /dev/null +++ b/src/lib/components/dicebear.svelte @@ -0,0 +1,20 @@ + + +{#if style === 'user'} + +{:else} + avatar +{/if} diff --git a/src/lib/objects/payggy/views/select-user.svelte b/src/lib/objects/payggy/views/select-user.svelte index d01f4474..00642d0e 100644 --- a/src/lib/objects/payggy/views/select-user.svelte +++ b/src/lib/objects/payggy/views/select-user.svelte @@ -51,7 +51,7 @@
  • setUser(user)}>
    - +
  • - +

    {(isYou ? 'You' : user?.name) ?? 'unknown'} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 626ef32d..2dc04846 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -94,7 +94,7 @@ @@ -127,7 +127,7 @@ @@ -159,9 +159,9 @@

    {#if isGroupChatId(chat.chatId)} - + {:else} - + {/if}
    diff --git a/src/routes/chat/[id]/+page.svelte b/src/routes/chat/[id]/+page.svelte index 8dffe683..349619a0 100644 --- a/src/routes/chat/[id]/+page.svelte +++ b/src/routes/chat/[id]/+page.svelte @@ -94,7 +94,7 @@ - + {otherUser?.name} @@ -110,7 +110,7 @@ .map((chat) => `"${chat.name}"`) .slice(0, 1)} - +

    Chat with "{chat?.name}"?

    diff --git a/src/routes/dev/+page.svelte b/src/routes/dev/+page.svelte deleted file mode 100644 index 9a15a410..00000000 --- a/src/routes/dev/+page.svelte +++ /dev/null @@ -1,35 +0,0 @@ - - -
    - -
    -
    Network
    -
    {defaultBlockchainNetwork.name}
    -
    -
    - - diff --git a/src/routes/group/chat/[id]/+page.svelte b/src/routes/group/chat/[id]/+page.svelte index 2323a77b..189b2901 100644 --- a/src/routes/group/chat/[id]/+page.svelte +++ b/src/routes/group/chat/[id]/+page.svelte @@ -140,7 +140,7 @@ - + {chat?.name} @@ -159,7 +159,7 @@ {#if !chat.joined} - +

    Join "{chat?.name}"?

    @@ -204,7 +204,7 @@ {@html replaceAddressesWithNames(textToHTML(htmlize(message.text)))} {#if message.fromAddress !== wallet.address && lastMessage} - + {/if} diff --git a/src/routes/group/chat/[id]/edit/+page.svelte b/src/routes/group/chat/[id]/edit/+page.svelte index 03b31b93..a5910ad5 100644 --- a/src/routes/group/chat/[id]/edit/+page.svelte +++ b/src/routes/group/chat/[id]/edit/+page.svelte @@ -24,7 +24,7 @@ import type { HDNodeWallet } from 'ethers' import routes from '$lib/routes' import { goto } from '$app/navigation' - import { getPicture, uploadPicture } from '$lib/adapters/ipfs' + import { uploadPicture } from '$lib/adapters/ipfs' import { onDestroy } from 'svelte' import Logout from '$lib/components/icons/logout.svelte' import { walletStore } from '$lib/stores/wallet' @@ -140,19 +140,7 @@
    -
    - {#if picture} -
    - profile -
    - {:else} -
    -
    - -
    -
    - {/if} -
    + Change picture @@ -180,7 +168,7 @@
    - +