aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
m---------recipes0
-rw-r--r--src/api/server/ServerApi.ts14
-rw-r--r--src/containers/auth/SetupAssistantScreen.tsx5
-rw-r--r--src/models/Recipe.ts5
-rw-r--r--src/models/Service.ts4
5 files changed, 23 insertions, 5 deletions
diff --git a/recipes b/recipes
Subproject 7ab6497fbd7bc64c3f2b17b587d273c9bbd155c Subproject f02fda1b07952648f84f91bf92343c81c841743
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';
15import ms from 'ms';
15import tar from 'tar'; 16import tar from 'tar';
16 17
17import RecipeModel, { type IRecipe } from '../../models/Recipe'; 18import 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
diff --git a/src/containers/auth/SetupAssistantScreen.tsx b/src/containers/auth/SetupAssistantScreen.tsx
index d15b4e6e1..b73b5705d 100644
--- a/src/containers/auth/SetupAssistantScreen.tsx
+++ b/src/containers/auth/SetupAssistantScreen.tsx
@@ -1,4 +1,5 @@
1import { inject, observer } from 'mobx-react'; 1import { inject, observer } from 'mobx-react';
2import ms from 'ms';
2import { Component, type ReactElement } from 'react'; 3import { Component, type ReactElement } from 'react';
3import type { StoresProps } from '../../@types/ferdium-components.types'; 4import type { StoresProps } from '../../@types/ferdium-components.types';
4import type { ILegacyServices } from '../../@types/legacy-types'; 5import type { ILegacyServices } from '../../@types/legacy-types';
@@ -83,11 +84,11 @@ class SetupAssistantScreen extends Component<IProps, IState> {
83 }); 84 });
84 85
85 // eslint-disable-next-line no-await-in-loop 86 // eslint-disable-next-line no-await-in-loop
86 await sleep(100); 87 await sleep(ms('100ms'));
87 } 88 }
88 89
89 this.setState({ isSettingUpServices: false }); 90 this.setState({ isSettingUpServices: false });
90 await sleep(100); 91 await sleep(ms('100ms'));
91 router.push('/'); 92 router.push('/');
92 } 93 }
93 94
diff --git a/src/models/Recipe.ts b/src/models/Recipe.ts
index 11eb1884f..87043693b 100644
--- a/src/models/Recipe.ts
+++ b/src/models/Recipe.ts
@@ -26,6 +26,7 @@ interface RecipeData {
26 message?: string; 26 message?: string;
27 allowFavoritesDelineationInUnreadCount?: boolean; 27 allowFavoritesDelineationInUnreadCount?: boolean;
28 }; 28 };
29 defaultIcon: string;
29} 30}
30 31
31export interface IRecipe { 32export interface IRecipe {
@@ -49,6 +50,7 @@ export interface IRecipe {
49 path: string; 50 path: string;
50 partition: string; 51 partition: string;
51 local: boolean; 52 local: boolean;
53 defaultIcon: string;
52 54
53 readonly overrideUserAgent?: () => string; 55 readonly overrideUserAgent?: () => string;
54 56
@@ -76,6 +78,8 @@ export default class Recipe implements IRecipe {
76 78
77 version = ''; 79 version = '';
78 80
81 defaultIcon = '';
82
79 // Removing this specific type will cause a typescript error 83 // Removing this specific type will cause a typescript error
80 // even while it's the exact same as the interface 84 // even while it's the exact same as the interface
81 aliases: string[] = []; 85 aliases: string[] = [];
@@ -135,6 +139,7 @@ export default class Recipe implements IRecipe {
135 // from the recipe 139 // from the recipe
136 this.id = ifUndefined<string>(data.id, this.id); 140 this.id = ifUndefined<string>(data.id, this.id);
137 this.name = ifUndefined<string>(data.name, this.name); 141 this.name = ifUndefined<string>(data.name, this.name);
142 this.defaultIcon = ifUndefined<string>(data.defaultIcon, this.defaultIcon);
138 this.version = ifUndefined<string>(data.version, this.version); 143 this.version = ifUndefined<string>(data.version, this.version);
139 this.aliases = ifUndefined<string[]>(data.aliases, this.aliases); 144 this.aliases = ifUndefined<string[]>(data.aliases, this.aliases);
140 this.serviceURL = ifUndefined<string>( 145 this.serviceURL = ifUndefined<string>(
diff --git a/src/models/Service.ts b/src/models/Service.ts
index 525661172..a61df5570 100644
--- a/src/models/Service.ts
+++ b/src/models/Service.ts
@@ -377,6 +377,10 @@ export default class Service {
377 return this.iconUrl; 377 return this.iconUrl;
378 } 378 }
379 379
380 if (this.recipe.defaultIcon) {
381 return this.recipe.defaultIcon;
382 }
383
380 return join(this.recipe.path, 'icon.svg'); 384 return join(this.recipe.path, 'icon.svg');
381 } 385 }
382 386