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

Fix bug that prevented accessing global in scenegraph inspector, prevent duplicate requests for same node #565

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions webviews/src/views/SceneGraphInspectorView/NodeDetailPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
import Loader from '../../shared/Loader.svelte';
import type { TreeNodeWithBase } from '../../shared/types';
export let inspectNodeTreeNode: TreeNodeWithBase | null;
let lastInspectNodeTreeNode;
$: {
// Updated persistentBaseKeyPath whenever inspectNodeTreeNode changes
if (inspectNodeTreeNode) {
// For some reason this is getting triggered twice so we do a check to see if the value is the same and only call refresh if it is different
if (lastInspectNodeTreeNode !== inspectNodeTreeNode) {
lastInspectNodeTreeNode = inspectNodeTreeNode;
refresh();
}
}
Expand Down Expand Up @@ -76,9 +78,9 @@

loading = true;

// We're switching to using reusable key path instead of nodeRef as the default unless we aren't part of the node tree
// We're switching to using reusable key path instead of nodeRef as the default unless we aren't part of the node tree or global
try {
if (inspectNodeTreeNode.parentRef < 0) {
if (inspectNodeTreeNode.base != 'global' && inspectNodeTreeNode.parentRef < 0) {
throw('fallback to nodeRef');
}

Expand Down