Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor saving local code to IndexedDB #123

Open
himself65 opened this issue Dec 14, 2021 · 2 comments
Open

refactor saving local code to IndexedDB #123

himself65 opened this issue Dec 14, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@himself65
Copy link
Contributor

const getLocalCodeList = () => {
try {
const result = localStorage.getItem('localNameList');
if (result) {
const list = JSON.parse(result) as string[];
const newLocalList = [];
for (let i = 0; i < list.length; i++) {
if (list[i] !== 'localNameList') {
newLocalList.push({
description: list[i],
source: localStorage.getItem(list[i]) as string
});
}
}
//console.log(newLocalList);
setLocalList(newLocalList);
} else {
localStorage.setItem('localNameList', JSON.stringify(['localNameList']));
}
} catch (err) {
throw new Error("Error while getting local code list: " + err);
}
};

@himself65 himself65 added the enhancement New feature or request label Dec 14, 2021
@AGDholo
Copy link
Member

AGDholo commented Dec 14, 2021

Local code has been removed in the latest version, so switch to the Dev branch.

https://github.com/Hedgehog-Computing/hedgehog-lab/blob/dev/packages/hedgehog-lab/src/pages/Main/Main.tsx

@AGDholo
Copy link
Member

AGDholo commented Dec 14, 2021

node lib:
https://github.com/dexie/Dexie.js

@AGDholo AGDholo added the help wanted Extra attention is needed label Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants