fix: Fix native themes not working on external editors (#2957) [skip e2e]

This commit is contained in:
Aman Harwara
2025-11-06 22:00:35 +05:30
committed by GitHub
parent cffb516b6e
commit 60e92c7035
4 changed files with 66 additions and 1 deletions

View File

@@ -38,6 +38,9 @@ import {
DocumentDirectoryPath,
DownloadDirectoryPath,
exists,
MainBundlePath,
readFile,
readFileAssets,
unlink,
writeFile,
} from 'react-native-fs'
@@ -508,6 +511,15 @@ export class MobileDevice implements MobileDeviceInterface {
}
}
async getNativeThemeCSS(identifier: string): Promise<string | undefined> {
let path = `Web.bundle/src/web-src/components/assets/${identifier}/index.css`
if (Platform.OS === 'ios') {
path = `${MainBundlePath}/${path}`
}
const content = Platform.OS === 'android' ? readFileAssets(path) : readFile(path)
return content
}
async previewFile(base64: string, filename: string): Promise<boolean> {
const tempLocation = await this.downloadBase64AsFile(base64, filename, true)