deep-foundation / deep-foundation/deeplinks

Unhandled Runtime Error Error: could not read block 6 in file "base/13458/16794": read only 0 of 8192 bytes

Open
#131 2 comments 0 reactions 2 assignees Claimed by @Menzorg View on GitHub
bug
Dominant language
TypeScript
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Screenshot 2023-03-25 at 23 41 44
insert this code in to queryClientQuery tsx (723)

```
({ deep, require }) => {
const React = require('react');
const { useState } = React;
const json5 = require('json5');
const { useContainer, Resize, EditorTextArea, CustomizableIcon } = require('@deep-foundation/deepcase');
const MonacoEditor = require('@monaco-editor/react');
const { Box, IconButton } = require('@chakra-ui/react');
const { BsCheck2, BsLightbulbFill, BsLightbulbOff } = require('react-icons/bs');
const motion = require('framer-motion');

// Only objects editor.
return ({ fillSize, style, link }) => {
// console.log('queryClientHandler', 'MonacoEditor');
const currentValue = deep.stringify(link?.value?.value) || '';
const [value, setValue] = useState(currentValue);
const isSaved = value == currentValue;
const [container] = useContainer();
const { data } = deep.useDeepSubscription({
type_id: { _in: [
deep.idLocal('@deep-foundation/core', 'Active'),
deep.idLocal('@deep-foundation/core', 'Contain'),
] },
to_id: { _eq: link.id },
});
const contain = data?.find(l => l.type_id === deep.idLocal('@deep-foundation/core', 'Contain'))
const active = data?.find(l => l.type_id === deep.idLocal('@deep-foundation/core', 'Active'))

const [viewSize, setViewSize] = useState({width: 200, height: 150});
const terminalBorderWidth = viewSize.width - 1;
const terminalBorderHeight = viewSize.height - 1;
const stackHeight = viewSize.height - 2;

// const [activate, setActive] = useState(false);
const [nested, setNested] = useState(false);

const body =





{
console.log('queryClientHandler', 'MonacoEditor', value);
setValue(value);
}}
// onMount={handleEditorDidMount}
/>


{
if (active) {
await deep.delete({
_or: [{
id: { _eq: active.id },
}, {
type_id: deep.idLocal('@deep-foundation/core', 'Contain'),
from_id: link.id,
to_id: active.id,
}],
});
} else {
await deep.insert({
type_id: deep.idLocal('@deep-foundation/core', 'Active'),
from_id: contain.from_id,
to_id: contain.to_id,
in: { data: {
type_id: deep.idLocal('@deep-foundation/core', 'Contain'),
from_id: link.id,
} },
});
}
}}
icon={active ? : }
/>
}
onClick={() => {
try {
const _value = json5.parse(value);
if (!link.value) deep.insert({
link_id: link.id, value: _value,
}, { table: 'objects' });
deep.update({ link_id: link.id }, { value: _value }, { table: 'objects' });
} catch(error) {}
}}
/>


;

return <>
{!fillSize
? body
: {body}};
}
}

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.