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

@@ -699,3 +699,17 @@ export function spaceSeparatedStrings(...strings: string[]): string {
export function pluralize(count: number, singular: string, plural: string): string {
return count === 1 ? singular : plural
}
export function blobToBase64(blob: Blob): Promise<string> {
return new Promise<string>((resolve, reject) => {
const reader = new FileReader()
reader.onloadend = () => {
if (reader.result && typeof reader.result === 'string') {
resolve(reader.result)
} else {
reject()
}
}
reader.readAsDataURL(blob)
})
}