mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Keep the context id in Core's entity records instead of on picked objects
registerEntityContext stamped __gevContextId on the entities, primitives and carriers it registered, and selection and pick resolution read it back. It is now the contextId field of the entity's Core record.
This commit is contained in:
1 parent
07c8d7a17c
commit
42b17ffab6
5 files changed
+18
-16
No files matched your search
@@ -12,7 +12,7 @@ import {
|
||||
localAdsbReceiverLine,
|
||||
localAdsbStatus,
|
||||
} from './index.js';
|
||||
import { readEntityRecord } from '../../data/entityRecords.js';
|
||||
import { entityRecord, readEntityRecord } from '../../data/entityRecords.js';
|
||||
|
||||
function fakeReceiver(initial = {}) {
|
||||
const state = {
|
||||
@@ -56,11 +56,11 @@ function fakeServices() {
|
||||
render: { governorRequestRender() {} },
|
||||
context: {
|
||||
registerEntityContext(entity, metadata) {
|
||||
entity.__gevContextId = metadata.id;
|
||||
entityRecord(entity).contextId = metadata.id;
|
||||
calls.registered.push(metadata);
|
||||
},
|
||||
selectEntityContext(entity) {
|
||||
selected = { id: entity.__gevContextId, entity };
|
||||
selected = { id: readEntityRecord(entity)?.contextId, entity };
|
||||
calls.selected.push(selected.id);
|
||||
return selected;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user