diff --git a/src/Lib/ComponentManager.ts b/src/Lib/ComponentManager.ts index 6561d779..5482ca49 100644 --- a/src/Lib/ComponentManager.ts +++ b/src/Lib/ComponentManager.ts @@ -64,8 +64,8 @@ export class ComponentManager extends SNComponentManager { } catch (e) { void this.alertService.alert( 'Unable to start component server. ' + - 'Editors other than the Plain Editor will fail to load. ' + - 'Please restart the app and try again.' + 'Editors other than the Plain Editor will fail to load. ' + + 'Please restart the app and try again.' ) SNLog.error(e as any) } @@ -317,6 +317,18 @@ export class ComponentManager extends SNComponentManager { return [] } } + + public async preloadThirdPartyThemeIndexPath() { + const theme = this.mobileActiveTheme + if (!theme) { + return + } + + const { identifier } = theme + if (this.isComponentThirdParty(identifier)) { + await this.preloadThirdPartyIndexPathFromDisk(identifier) + } + } } export async function associateComponentWithNote(application: SNApplication, component: SNComponent, note: SNNote) { diff --git a/src/Style/ThemeService.ts b/src/Style/ThemeService.ts index 69d82092..3bded8d0 100644 --- a/src/Style/ThemeService.ts +++ b/src/Style/ThemeService.ts @@ -262,6 +262,7 @@ export class ThemeService { const matchingThemeId = Object.keys(this.themes).find(themeId => themeId === savedThemeId) if (matchingThemeId) { this.setActiveTheme(matchingThemeId) + void this.application?.mobileComponentManager.preloadThirdPartyThemeIndexPath() } else { this.setDefaultTheme() }