removed old cookie handling

This commit is contained in:
antelle 2020-05-13 16:37:35 +02:00
parent 8e4566fe5f
commit 955a1346ff
No known key found for this signature in database
GPG Key ID: 094A2F2D6136A4EE
2 changed files with 0 additions and 38 deletions

View File

@ -10,10 +10,6 @@ class RuntimeDataModel extends Model {
load() {
return SettingsStore.load('runtime-data').then(data => {
if (data) {
if (data.cookies) {
// we're not using cookies here now
delete data.cookies;
}
this.set(data, { silent: true });
}
});

View File

@ -56,7 +56,6 @@ perfTimestamps?.push({ name: 'defining args', ts: process.hrtime() });
setDevAppIcon();
setEnv();
restorePreferences();
const appSettings = readAppSettings() || {};
@ -489,39 +488,6 @@ function setEnv() {
perfTimestamps?.push({ name: 'setting env', ts: process.hrtime() });
}
function restorePreferences() {
const profileConfigPath = path.join(userDataDir, 'profile.json');
const newProfile = { dir: tempUserDataPathRand };
let oldProfile;
try {
oldProfile = JSON.parse(fs.readFileSync(profileConfigPath, 'utf8'));
} catch (e) {}
fs.writeFileSync(profileConfigPath, JSON.stringify(newProfile));
if (oldProfile && oldProfile.dir && /^[\d.]+$/.test(oldProfile.dir)) {
const oldProfilePath = path.join(tempUserDataPath, oldProfile.dir);
const newProfilePath = path.join(tempUserDataPath, newProfile.dir);
if (fs.existsSync(path.join(oldProfilePath, 'Cookies'))) {
if (!fs.existsSync(newProfilePath)) {
fs.mkdirSync(newProfilePath);
}
const cookiesFileSrc = path.join(oldProfilePath, 'Cookies');
const cookiesFileDest = path.join(newProfilePath, 'Cookies');
try {
fs.renameSync(cookiesFileSrc, cookiesFileDest);
} catch (e) {
try {
fs.copyFileSync(cookiesFileSrc, cookiesFileDest);
} catch (e) {}
}
}
}
perfTimestamps?.push({ name: 'restoring preferences', ts: process.hrtime() });
}
function deleteOldTempFiles() {
if (app.oldTempFilesDeleted) {
return;