mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 15:47:08 +00:00
Use Cache API instead of LocalStorage (#128)
* Use Cache API instead of LocalStorage * Remove old cached data
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Errors, Hook, relativePath } from '@mcschema/core'
|
||||
import { BlockStateRegistry } from '../App'
|
||||
import { App, BlockStateRegistry } from '../App'
|
||||
import { getFilterKey } from './getFilterKey'
|
||||
import { walk } from './walk'
|
||||
|
||||
@@ -17,7 +17,7 @@ export const customValidation: Hook<[any, Errors], void> = walk<[Errors]>({
|
||||
const block = relativePath(path, config.validation.params.id).get()
|
||||
const errors = path.getModel().errors
|
||||
|
||||
const requiredProps = (BlockStateRegistry[block] ?? {}).properties ?? {}
|
||||
const requiredProps = (App.blockStateRegistry[block] ?? {}).properties ?? {}
|
||||
const existingKeys = Object.keys(value ?? {})
|
||||
Object.keys(requiredProps).forEach(p => {
|
||||
if (!existingKeys.includes(p)) {
|
||||
|
||||
@@ -113,7 +113,7 @@ export const renderHtml: Hook<[any, Mounter], [string, string, string]> = {
|
||||
path.model.set(path.push(key), children.default())
|
||||
})
|
||||
let suffix = ''
|
||||
const blockState = (config.validation?.validator === 'block_state_map' ? BlockStateRegistry[relativePath(path, config.validation.params.id).get()] : null)
|
||||
const blockState = (config.validation?.validator === 'block_state_map' ? App.blockStateRegistry[relativePath(path, config.validation.params.id).get()] : null)
|
||||
if (!blockState || blockState.properties) {
|
||||
const keyRendered = (blockState
|
||||
? StringNode(null!, { enum: Object.keys(blockState.properties ?? {}) })
|
||||
|
||||
Reference in New Issue
Block a user