Skip to content

Commit

Permalink
fix: use constructor name if type is known (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie authored May 29, 2024
1 parent e7e2ca9 commit b36ddc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: Test Lint
run: npm run lint

- name: Test Types
run: npm run types

Expand Down
4 changes: 4 additions & 0 deletions packages/devtool-chrome/src/inject/scene/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export class Tree {
}

private _getName(container: Container, type: PixiNodeType) {
if (type === 'Unknown') {
type = container.constructor.name as PixiNodeType;
}

const stage = this._devtool.stage;
const name = this._devtool.majorVersion === '8' ? container.label : container.name;
const nameIsType = name === type;
Expand Down
5 changes: 1 addition & 4 deletions packages/devtool-local/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ const mockBridge: BridgeFn = (code): Promise<any> => {

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<div
id="root"
style={{ display: 'flex', flexDirection: 'column', maxHeight: '100vh', alignItems: 'center' }}
>
<div id="root" style={{ display: 'flex', flexDirection: 'column', maxHeight: '100vh', alignItems: 'center' }}>
<canvas id="canvas" style={{ width: '600px', height: '450px' }} />
<div style={{ width: '100%', height: '100%', overflow: 'hidden' }}>
<App bridge={mockBridge} chromeProxy={mockChrome} />
Expand Down

0 comments on commit b36ddc9

Please sign in to comment.