Skip to content

Commit 110f2b0

Browse files
authored
Merge pull request #188 from Open-STEM/kq-bugs
Fixed isSavetoXRP state in localstorage.
2 parents b648e00 + 6647b56 commit 110f2b0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/components/blockly.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ function BlocklyEditor({ name }: BlocklyEditorProps) {
164164
/**
165165
* saveEditor
166166
*/
167-
function saveEditor() {
167+
async function saveEditor() {
168168
const ws = EditorMgr.getInstance().getEditorSession(name)?.workspace;
169169
if (ws) {
170170
const activeTab = localStorage.getItem(StorageKeys.ACTIVETAB)?.replace(/^"|"$/g, '');
171171
if (activeTab === name) {
172172
const code = blocklyToPython(ws);
173173
console.log('Saving blockly', activeTab, code);
174-
EditorMgr.getInstance().saveEditor(name, code);
174+
await EditorMgr.getInstance().saveEditor(name, code);
175175
EditorMgr.getInstance().SaveToLocalStorage(
176176
EditorMgr.getInstance().getEditorSession(name) as EditorSession,
177177
code

src/managers/editormgr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export default class EditorMgr {
281281
path: session.path,
282282
gpath: session.gpath,
283283
isBlockly: session.type === EditorType.BLOCKLY,
284-
isSavedToXRP: session.isModified,
284+
isSavedToXRP: !session.isModified,
285285
content: code,
286286
};
287287
// Update the session content with the new code

0 commit comments

Comments
 (0)