+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/config/ifruit.ts b/frontend/src/config/ifruit.ts
deleted file mode 100644
index 34c54de..0000000
--- a/frontend/src/config/ifruit.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const IFRUIT_AUTH_INPUT_COLORS = {
- outlineLabelBgIos: 'bg-black',
-}
diff --git a/frontend/src/stores/darkchat.test.ts b/frontend/src/stores/darkchat.test.ts
index 811ab04..2cedfd7 100644
--- a/frontend/src/stores/darkchat.test.ts
+++ b/frontend/src/stores/darkchat.test.ts
@@ -67,6 +67,33 @@ describe('darkchat store', () => {
expect(store.messages[0].deliveryStatus).toBe('failed')
})
+ it('uses a local media preview without sending that URL to the server', async () => {
+ mockNuiCall
+ .mockResolvedValueOnce({ data: { conversation, messages: [] }, success: true })
+ .mockResolvedValueOnce({ data: { contacts: [], conversations: [], profile: null }, success: true })
+ .mockResolvedValueOnce({ data: { ...message('media-id'), messageType: 'image' }, success: true })
+ .mockResolvedValueOnce({ data: { contacts: [], conversations: [], profile: null }, success: true })
+
+ const store = useDarkChatStore()
+ await store.openThread(conversation.id)
+ const sending = store.send({
+ mediaAssetId: '17',
+ mediaPreviewUrl: 'https://media.example/photo.jpg',
+ messageType: 'image',
+ })
+
+ expect(store.messages[0]).toMatchObject({
+ mediaPayload: 'https://media.example/photo.jpg',
+ messageType: 'image',
+ })
+ expect(mockNuiCall).toHaveBeenNthCalledWith(3, 'darkchat:send', {
+ conversationId: conversation.id,
+ mediaAssetId: '17',
+ messageType: 'image',
+ })
+ await sending
+ })
+
it('loads protected voice data once', async () => {
mockNuiCall.mockResolvedValueOnce({
data: { mime: 'audio/webm;codecs=opus', payload: 'ZmFrZQ==' },
diff --git a/frontend/src/stores/darkchat.ts b/frontend/src/stores/darkchat.ts
index 088d133..47a3b9b 100644
--- a/frontend/src/stores/darkchat.ts
+++ b/frontend/src/stores/darkchat.ts
@@ -76,6 +76,7 @@ export const useDarkChatStore = defineStore('darkchat', () => {
async function send(outgoing: DarkChatOutgoing): Promise