mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Keep the context id in the app'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 own record.
This commit is contained in:
1 parent
393a145137
commit
2394703c14
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