fix(blocker): remove the app.isPackaged check (fix #1315)

This commit is contained in:
JellyBrick
2023-10-15 18:33:14 +09:00
parent f924b6c8e3
commit 4d01cdfa6c

View File

@ -24,12 +24,7 @@ export const loadAdBlockerEngine = async (
disableDefaultLists: boolean | unknown[] = false,
) => {
// Only use cache if no additional blocklists are passed
let cacheDirectory: string;
if (app.isPackaged) {
cacheDirectory = path.join(app.getPath('userData'), 'adblock_cache');
} else {
cacheDirectory = path.resolve(__dirname, 'adblock_cache');
}
const cacheDirectory = path.join(app.getPath('userData'), 'adblock_cache');
if (!fs.existsSync(cacheDirectory)) {
fs.mkdirSync(cacheDirectory);
}