mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-25 16:16:50 +00:00
Fix indexeddb file system readdir to use a range
This commit is contained in:
@@ -381,7 +381,7 @@ function formatUnionMember(type: SimplifiedMcdocTypeNoUnion, others: SimplifiedM
|
||||
}
|
||||
if (!others.some(o => o.kind === type.kind)) {
|
||||
// No other member is of this kind
|
||||
return formatIdentifier(type.kind)
|
||||
return formatIdentifier(type.kind === 'struct' ? 'object' : type.kind)
|
||||
}
|
||||
if (type.kind === 'struct') {
|
||||
// Show the first literal key
|
||||
@@ -390,7 +390,7 @@ function formatUnionMember(type: SimplifiedMcdocTypeNoUnion, others: SimplifiedM
|
||||
return formatUnionMember(firstKey, [])
|
||||
}
|
||||
}
|
||||
return formatIdentifier(type.kind)
|
||||
return formatIdentifier(type.kind === 'struct' ? 'object' : type.kind)
|
||||
}
|
||||
|
||||
function UnionBody({ type, optional, node, ctx }: Props<UnionType<SimplifiedMcdocTypeNoUnion>>) {
|
||||
|
||||
@@ -29,7 +29,7 @@ export function ProjectPanel() {
|
||||
setEntries(undefined)
|
||||
client.fs.readdir(projectRoot).then(entries => {
|
||||
setEntries(entries.flatMap(e => {
|
||||
return e.isFile() && e.name.startsWith(projectRoot) ? [e.name.slice(projectRoot.length)] : []
|
||||
return e.isFile() ? [e.name.slice(projectRoot.length)] : []
|
||||
}))
|
||||
})
|
||||
}, [projectRoot])
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { VersionId } from '../../services/index.js'
|
||||
import { checkVersion, fetchDependencyMcdoc, fetchPreset, fetchRegistries, getSnippet, shareSnippet } from '../../services/index.js'
|
||||
import { DEPENDENCY_URI, SpyglassClient } from '../../services/Spyglass.js'
|
||||
import { Store } from '../../Store.js'
|
||||
import { cleanUrl, genPath } from '../../Utils.js'
|
||||
import { cleanUrl, clearFolder, genPath } from '../../Utils.js'
|
||||
import { Ad, Btn, BtnMenu, ErrorPanel, FileCreation, FileView, Footer, HasPreview, Octicon, PreviewPanel, ProjectPanel, SearchList, SourcePanel, TextInput, VersionSwitcher } from '../index.js'
|
||||
import { getRootDefault } from './McdocHelpers.js'
|
||||
|
||||
@@ -94,10 +94,7 @@ export function SchemaGenerator({ gen, allowedVersions }: Props) {
|
||||
if (!service || !uri) {
|
||||
return AsyncCancel
|
||||
}
|
||||
const dependencies = await SpyglassClient.FS.readdir(DEPENDENCY_URI)
|
||||
await Promise.all(dependencies.flatMap(async d => {
|
||||
d.isFile() && d.name.startsWith(DEPENDENCY_URI) ? [await SpyglassClient.FS.unlink(d.name)] : []
|
||||
}))
|
||||
await clearFolder(SpyglassClient.FS, DEPENDENCY_URI)
|
||||
if (gen.dependency) {
|
||||
const dependency = await fetchDependencyMcdoc(gen.dependency)
|
||||
const dependencyUri = `${DEPENDENCY_URI}${gen.dependency}.mcdoc`
|
||||
|
||||
Reference in New Issue
Block a user