At the moment the conversation list does not maintain a proper order. It should list conversations according to the following criteria
[x] Newly added conversations should be at the top
[x] conversations should be ordered by its latest message.
1063 adds the field updatedAt on the backend side. The conversation state in the FE should have a similar field to track the latest conversations efficiently.
[x] add the field updatedAt to ContactPreview. These field should be a number containing the timestamp of the latest updated
[x] add a function to useConversation that can be called from outside to update the ContactPreview of a certain conversation. Args: (conversation:string, updateAt:number)
[x] in use message call the update conversation method every time a new message has been received via delivery service or websocket.
[x] add tests for every method ensure that updatedAt has set correctly
At the moment the conversation list does not maintain a proper order. It should list conversations according to the following criteria
1063 adds the field updatedAt on the backend side. The conversation state in the FE should have a similar field to track the latest conversations efficiently.