public async deleteConversation(user: Contact): Promise<void> {
this.conversationStorage.remove(user.id);
const messages = await this.conversationStorage.get('conversations');
console.log(messages); //<--nothing deleted
}
this.conversationStorage.get('conversations').then((conversation: Conversation): void => {
if (conversation.id === user.id) {
delete conversation.id;
}
});
still nothing deleted
message.service
export class ChatService {
private conversationStorage: Storage;
public constructor () {
this.conversationStorage = new Storage({
name: 'messageStorage',
storeName: '_messageStorage',
}); // note you can't declare Storage in constructor if you want to create an instance
}
// the function listed above