diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2024-05-04 06:21:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-04 10:51:46 +0530 |
commit | 3274625fa309362073a7808490e5d0a3e34b2df6 (patch) | |
tree | a0b82ba9507eed6945d076b27f3e48aeea8aeb55 /src/api | |
parent | 6.7.4-nightly.3 [skip ci] (diff) | |
download | ferdium-app-3274625fa309362073a7808490e5d0a3e34b2df6.tar.gz ferdium-app-3274625fa309362073a7808490e5d0a3e34b2df6.tar.zst ferdium-app-3274625fa309362073a7808490e5d0a3e34b2df6.zip |
chore: change icons to reduce bundle (#1740)
* Made the sleep in millis more explicit
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/server/ServerApi.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/api/server/ServerApi.ts b/src/api/server/ServerApi.ts index b5dd499ab..5434880dc 100644 --- a/src/api/server/ServerApi.ts +++ b/src/api/server/ServerApi.ts | |||
@@ -12,6 +12,7 @@ import { | |||
12 | statSync, | 12 | statSync, |
13 | writeFileSync, | 13 | writeFileSync, |
14 | } from 'fs-extra'; | 14 | } from 'fs-extra'; |
15 | import ms from 'ms'; | ||
15 | import tar from 'tar'; | 16 | import tar from 'tar'; |
16 | 17 | ||
17 | import RecipeModel, { type IRecipe } from '../../models/Recipe'; | 18 | import RecipeModel, { type IRecipe } from '../../models/Recipe'; |
@@ -460,7 +461,7 @@ export default class ServerApi { | |||
460 | } | 461 | } |
461 | debug(archivePath); | 462 | debug(archivePath); |
462 | 463 | ||
463 | await sleep(10); | 464 | await sleep(ms('10ms')); |
464 | 465 | ||
465 | await tar.x({ | 466 | await tar.x({ |
466 | file: archivePath, | 467 | file: archivePath, |
@@ -471,14 +472,21 @@ export default class ServerApi { | |||
471 | onwarn: x => debug('warn', recipeId, x), | 472 | onwarn: x => debug('warn', recipeId, x), |
472 | }); | 473 | }); |
473 | 474 | ||
474 | await sleep(10); | 475 | await sleep(ms('10ms')); |
475 | 476 | ||
476 | const { id } = readJsonSync(join(recipeTempDirectory, 'package.json')); | 477 | const { id, defaultIcon } = readJsonSync( |
478 | join(recipeTempDirectory, 'package.json'), | ||
479 | ); | ||
477 | const recipeDirectory = join(recipesDirectory, id); | 480 | const recipeDirectory = join(recipesDirectory, id); |
478 | copySync(recipeTempDirectory, recipeDirectory); | 481 | copySync(recipeTempDirectory, recipeDirectory); |
479 | removeSync(recipeTempDirectory); | 482 | removeSync(recipeTempDirectory); |
480 | removeSync(join(recipesDirectory, recipeId, 'recipe.tar.gz')); | 483 | removeSync(join(recipesDirectory, recipeId, 'recipe.tar.gz')); |
481 | 484 | ||
485 | // TODO: This is a temporary fix to remove svg icons from the user AppData. This should be removed after versions of all recipes have been bumped up | ||
486 | if (defaultIcon) { | ||
487 | removeSync(join(recipeDirectory, 'icon.svg')); | ||
488 | } | ||
489 | |||
482 | return id; | 490 | return id; |
483 | } | 491 | } |
484 | 492 | ||