Disable image preload

This commit is contained in:
Fedor Indutny 2023-05-01 13:42:34 -07:00 committed by GitHub
parent 6154b83720
commit 00349b5b33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 58 deletions

View file

@ -3,8 +3,6 @@
import { join, relative, normalize } from 'path';
import fastGlob from 'fast-glob';
import glob from 'glob';
import pify from 'pify';
import fse from 'fs-extra';
import { map, isString } from 'lodash';
import normalizePath from 'normalize-path';
@ -113,16 +111,6 @@ export const getAllDraftAttachments = async (
return map(files, file => relative(dir, file));
};
export const getBuiltInImages = async (): Promise<ReadonlyArray<string>> => {
const dir = join(__dirname, '../images');
const pattern = join(dir, '**', '*.svg');
// Note: we cannot use fast-glob here because, inside of .asar files, readdir will not
// honor the withFileTypes flag: https://github.com/electron/electron/issues/19074
const files = await pify(glob)(pattern, { nodir: true });
return map(files, file => relative(dir, file));
};
export const clearTempPath = (userDataPath: string): Promise<void> => {
const tempPath = getTempPath(userDataPath);
return fse.emptyDir(tempPath);