fix: Fixed issue on Android where deprecated editors wouldn't load
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
GetIframeEditors,
|
||||
GetNativeThemes,
|
||||
NativeFeatureIdentifier,
|
||||
GetDeprecatedEditors,
|
||||
} from '@standardnotes/features'
|
||||
import { Copy, removeFromArray, sleep, isNotUndefined, LoggerInterface } from '@standardnotes/utils'
|
||||
import { ComponentViewer } from '@Lib/Services/ComponentManager/ComponentViewer'
|
||||
@@ -106,6 +107,7 @@ export class ComponentManager
|
||||
|
||||
this.addSyncedComponentItemObserver()
|
||||
this.registerMobileNativeComponentUrls()
|
||||
this.registerDeprecatedEditorUrlsForAndroid()
|
||||
|
||||
this.eventDisposers.push(
|
||||
preferences.addEventObserver((event) => {
|
||||
@@ -292,6 +294,23 @@ export class ComponentManager
|
||||
}
|
||||
}
|
||||
|
||||
private registerDeprecatedEditorUrlsForAndroid(): void {
|
||||
if (!isMobileDevice(this.device)) {
|
||||
return
|
||||
}
|
||||
|
||||
const deprecatedEditors = [...GetDeprecatedEditors()]
|
||||
|
||||
for (const component of deprecatedEditors) {
|
||||
const feature = new UIFeature<ComponentFeatureDescription>(component)
|
||||
const url = this.urlForFeature(feature)
|
||||
|
||||
if (url) {
|
||||
this.device.registerComponentUrl(feature.uniqueIdentifier.value, url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
detectFocusChange = (): void => {
|
||||
const activeIframes = Array.from(document.getElementsByTagName('iframe'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user