mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-09 03:09:12 -06:00
Fix noms browser fetch and splore layout (#1989)
This commit is contained in:
@@ -48,7 +48,10 @@ export function fetchText(url: string, options: FetchOptions = {}): Promise<Text
|
||||
if (self.fetch) {
|
||||
return self.fetch(url, options)
|
||||
// resp.headers is a Headers which is a multi map, which is similar enough for now.
|
||||
.then(resp => ({headers: resp.headers, buf: resp.text()}));
|
||||
.then(resp => {
|
||||
const {headers} = resp;
|
||||
return resp.text().then(text => ({headers, buf: text}));
|
||||
});
|
||||
}
|
||||
|
||||
return fetch(url, 'text', options);
|
||||
@@ -58,7 +61,10 @@ export function fetchUint8Array(url: string, options: FetchOptions = {}): Promis
|
||||
if (self.fetch) {
|
||||
return self.fetch(url, options)
|
||||
// resp.headers is a Headers which is a multi map, which is similar enough for now.
|
||||
.then(resp => ({headers: resp.headers, buf: new Uint8Array(resp.arrayBuffer())}));
|
||||
.then(resp => {
|
||||
const {headers} = resp;
|
||||
return resp.arrayBuffer().then(buf => ({headers, buf: new Uint8Array(buf)}));
|
||||
});
|
||||
}
|
||||
|
||||
return fetch(url, 'arraybuffer', options);
|
||||
|
||||
@@ -97,7 +97,7 @@ function handleChunkLoad(hash: Hash, val: any, fromHash: ?string) {
|
||||
name: string) {
|
||||
data.nodes[id] = {name: name};
|
||||
sequence.items.forEach(tuple => {
|
||||
const kid = process(hash, formatKeyString(tuple.child), id);
|
||||
const kid = process(hash, formatKeyString(tuple.ref), id);
|
||||
if (kid) {
|
||||
data.nodes[kid].isOpen = true;
|
||||
|
||||
|
||||
@@ -69,12 +69,8 @@ export default class Node extends React.Component<void, Props, State> {
|
||||
<g className='node' onClick={this.props.onClick} style={{transform:translate}}>
|
||||
{this.getShape()}
|
||||
<foreignObject x={-this.props.spaceX + 10} y='-.35em'
|
||||
width={this.props.spaceX - 20} height='0.7em'
|
||||
requiredExtensions='http://www.w3.org/1999/xhtml'>
|
||||
<p xmlns='http://www.w3.org/1999/xhtml' title={this.props.title || this.props.text}
|
||||
style={paraStyle}>
|
||||
{text}
|
||||
</p>
|
||||
width={this.props.spaceX - 20} height='0.7em'>
|
||||
<p title={this.props.title || this.props.text} style={paraStyle}>{text}</p>
|
||||
</foreignObject>
|
||||
</g>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user