removed some old stuff from v1.15

pull/1631/head
antelle 2020-06-21 13:04:09 +02:00
parent 0e3d01ade6
commit 17be9cf266
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
1 changed files with 0 additions and 35 deletions

View File

@ -105,7 +105,6 @@ app.on('ready', () => {
createMainWindow();
setGlobalShortcuts(appSettings);
subscribePowerEvents();
deleteOldTempFiles();
hookRequestHeaders();
})
.catch((e) => {
@ -624,32 +623,6 @@ function setEnv() {
logProgress('setting env');
}
// TODO: delete after v1.15
function deleteOldTempFiles() {
if (app.oldTempFilesDeleted) {
return;
}
setTimeout(() => {
const tempPath = path.join(app.getPath('userData'), 'temp');
if (fs.existsSync(tempPath)) {
deleteRecursive(tempPath);
}
app.oldTempFilesDeleted = true; // this is added to prevent file deletion on restart
}, 1000);
}
function deleteRecursive(dir) {
for (const file of fs.readdirSync(dir)) {
const filePath = path.join(dir, file);
if (fs.lstatSync(filePath).isDirectory()) {
deleteRecursive(filePath);
} else {
fs.unlinkSync(filePath);
}
}
fs.rmdirSync(dir);
}
function setDevAppIcon() {
if (isDev && htmlPath && process.platform === 'darwin') {
const icon = electron.nativeImage.createFromPath(
@ -772,14 +745,6 @@ function loadSettingsEncryptionKey() {
return null;
}
const explicitlyDisabledFile = path.join(app.getPath('userData'), 'disable-keytar');
if (fs.existsSync(explicitlyDisabledFile)) {
// TODO: remove this fallback if everything goes well on v1.15
// This is a protective measure if everything goes terrible with native modules
// For example, the app can crash and it won't be possible to use it at all
return null;
}
const keytar = reqNative('keytar');
return keytar.getPassword('KeeWeb', 'settings-key').then((key) => {