mirror of
https://github.com/standardnotes/mobile.git
synced 2026-08-02 16:27:31 -04:00
fix: crash when using a 3rd-party theme with native features (#615)
* fix: crash when using a 3rd-party theme with native features * fix: preload 3rd-party theme from ThemeService * fix: take preloadThirdPartyThemeIndexPath outside of setActiveTheme * fix: move preloadThirdPartyThemeIndexPath to component manager Co-authored-by: Johnny Almonte <johnny243@users.noreply.github.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user