Add storage for openscad code

This commit is contained in:
Kurt Hutten
2021-03-21 14:59:47 +11:00
parent f9f35183af
commit fef69917f5
3 changed files with 8 additions and 2 deletions

View File

@@ -16,11 +16,14 @@ module stick(basewid, angl){
}
}`
export const codeStorageKey = 'Last-openscad-code'
export const useIdeState = () => {
const code = localStorage.getItem(codeStorageKey) || donutInitCode
const initialState = {
ideType: 'openScad',
consoleMessages: [{ type: 'message', message: 'Initialising OpenSCAD' }],
code: donutInitCode,
code,
objectData: {
type: 'stl',
data: 'some binary',