Skip to content

Commit 3d48221

Browse files
committed
Split tokens from imported scripts with new lines
1 parent 833002d commit 3d48221

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/editor/dialogs/import-script-dialog/ImportScriptDialog.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ActiveDialog } from '../../../state/types';
55
import { createInsecureUuidV4 } from '../../../utils';
66
import { toConventionalId } from '../../common';
77

8-
import { disassembleBytecodeBCH, hexToBin } from '@bitauth/libauth';
8+
import { disassembleBytecodeBch, hexToBin } from '@bitauth/libauth';
99
import {
1010
Button,
1111
Classes,
@@ -16,7 +16,7 @@ import {
1616
import { WarningSign } from '@blueprintjs/icons';
1717
import React, { useState } from 'react';
1818

19-
const disassembleHex = (hex: string) => disassembleBytecodeBCH(hexToBin(hex));
19+
const disassembleHex = (hex: string) => disassembleBytecodeBch(hexToBin(hex));
2020
const tokenizeHex = (hex: string) => {
2121
const splitAtErrors = disassembleHex(hex).split('[');
2222
return [
@@ -151,7 +151,10 @@ export const ImportScriptDialog = ({
151151
id: scriptId,
152152
internalId: createInsecureUuidV4(),
153153
type: 'isolated',
154-
contents: disassembleHex(bytecode).split('[')[0],
154+
contents: disassembleHex(bytecode)
155+
.split('[')[0]!
156+
.split(' ')
157+
.join('\n'),
155158
});
156159
closeDialog();
157160
}

0 commit comments

Comments
 (0)