Skip to content

Commit d116df0

Browse files
authored
Merge pull request #146 from Open-STEM/kq-bug-136
Addressed google drive file load issue
2 parents 2954137 + 133cd03 commit d116df0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/navbar.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,11 @@ function NavBar({ layoutref }: NavBarProps) {
186186
driveService.getFileContents(filePathData.gPath).then((fileContent) => {
187187
let content;
188188
if (fileType === FileType.BLOCKLY) {
189-
content = fileContent?.split('##XRPBLOCKS ');
189+
content = fileContent?.split('##XRPBLOCKS ').at(1);
190+
} else {
191+
content = fileContent;
190192
}
191-
const loadContent = { name: filename, content: content?.at(1)};
193+
const loadContent = { name: filename, content: content };
192194
AppMgr.getInstance().emit(EventType.EVENT_EDITOR_LOAD, JSON.stringify(loadContent));
193195
});
194196
}

0 commit comments

Comments
 (0)