Add an assertion when updating conversations; update cleanData
This commit is contained in:
parent
73a304faba
commit
bc37b5c907
23 changed files with 749 additions and 79 deletions
|
@ -23,6 +23,7 @@ const rimraf = require('rimraf');
|
|||
const electronRemote = require('electron').remote;
|
||||
|
||||
const crypto = require('../../ts/Crypto');
|
||||
const { getEnvironment } = require('../../ts/environment');
|
||||
|
||||
const { dialog, BrowserWindow } = electronRemote;
|
||||
|
||||
|
@ -1198,7 +1199,7 @@ function deleteAll(pattern) {
|
|||
const ARCHIVE_NAME = 'messages.tar.gz';
|
||||
|
||||
async function exportToDirectory(directory, options) {
|
||||
const env = window.getEnvironment();
|
||||
const env = getEnvironment();
|
||||
if (env !== 'test') {
|
||||
throw new Error('export is only supported in test mode');
|
||||
}
|
||||
|
@ -1266,7 +1267,7 @@ async function importFromDirectory(directory, options) {
|
|||
|
||||
const archivePath = path.join(directory, ARCHIVE_NAME);
|
||||
if (fs.existsSync(archivePath)) {
|
||||
const env = window.getEnvironment();
|
||||
const env = getEnvironment();
|
||||
if (env !== 'test') {
|
||||
throw new Error('import is only supported in test mode');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue