Skip to content

Commit

Permalink
Merge pull request #956 from vorth/legacy-field-names
Browse files Browse the repository at this point in the history
Fixes for 3 online bugs
  • Loading branch information
vorth authored Jan 11, 2025
2 parents 5c4c4cb + 5440ba0 commit d093225
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion online/src/app/classic/menus/filemenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const FileMenu = () =>
}

// Open the design indicated in the query string, if any
onMount( () => url && openUrl( url ) );
onMount( () => ( url && url.endsWith( ".vZome" ) ) ? openUrl( url ) : doCreate( 'golden' ) );

const [ svgPreview, setSvgPreview ] = createSignal( false );

Expand Down
1 change: 0 additions & 1 deletion online/src/app/framework/context/editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ const EditorProvider = props =>
{
if ( ! state.controller ) {
setState( 'controller', { __store: store, __path: [] } ); // empower every subcontroller to access this store
workerClient .postMessage( actions.newDesign() );
}
return state.controller;
};
Expand Down
8 changes: 7 additions & 1 deletion online/src/app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ const LegacyViewer = () =>

const Online = () =>
{
const reportError = err =>
{
console.log( 'ErrorBoundary:', err.toString() );
return <div>{err.toString()}</div>
}

return (
<ErrorBoundary fallback={ err => <div>{err.toString()}</div> } >
<ErrorBoundary fallback={ reportError } >
<CameraProvider name='main' >
<WorkerProvider>
<ImageCaptureProvider>
Expand Down
1 change: 1 addition & 0 deletions online/src/worker/legacy/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const initializeDesign = ( loading, polygons, legacyDesign, clientEvents ) =>
instances = snapshots .pop();
} else {
instances = renderHistory .getSnapshot( '--START--' );
snapshots = [];
}

const wrapper = createControllers( legacyDesign, renderingChanges, clientEvents );
Expand Down
5 changes: 3 additions & 2 deletions online/src/worker/legacy/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,12 @@ const makeFloatMatrices = ( matrices ) =>

const fieldApps = {}
const wrapLegacyField = ( legacyField ) => ({
origin: () => legacyField.origin( 3 ).getComponents().map( an => an.toTrailingDivisor() )
origin: () => legacyField.origin( 3 ).getComponents().map( an => an.toTrailingDivisor() ),
name: legacyField.getName(),
})
const addLegacyField = ( fieldClass, appClass ) =>
{
const legacyField = new fieldClass( algebraicNumberFactory )
const legacyField = new fieldClass( algebraicNumberFactory );
legacyField.delegate = wrapLegacyField( legacyField )
fieldApps[ legacyField.getName() ] = new appClass( legacyField )
}
Expand Down

0 comments on commit d093225

Please sign in to comment.