From 3a618aca2a0d19216cd655d66a4d7a4c5b1be07e Mon Sep 17 00:00:00 2001 From: eight Date: Sat, 6 Oct 2018 03:19:51 +0800 Subject: [PATCH] WIP: use deepCopy --- js/msg.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/msg.js b/js/msg.js index 33589a66..31ee7a43 100644 --- a/js/msg.js +++ b/js/msg.js @@ -1,4 +1,4 @@ -/* global promisify */ +/* global promisify deepCopy */ 'use strict'; const msg = (() => { @@ -174,7 +174,9 @@ const msg = (() => { return preparing.then(() => exchangeGet(message, keepStorage)); } message.data = bg._msg.storage.get(message.id); - if (!keepStorage) { + if (keepStorage) { + message.data = deepCopy(data); + } else { bg._msg.storage.delete(message.id); } }