mirror of https://github.com/keeweb/keeweb
removed old cookie handling
parent
8e4566fe5f
commit
955a1346ff
|
@ -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 });
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue