fix: Fix native themes not working on external editors (#2957) [skip e2e]
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user