Fix keyboard actions for screen and nav

This commit is contained in:
Andrew Kingston 2023-08-23 15:41:45 +01:00
parent 0ef0e58e5e
commit 277aa30b07
2 changed files with 2 additions and 5 deletions

View File

@ -63,9 +63,9 @@ export const selectedComponent = derived(
([$store, $selectedScreen]) => {
if (
$selectedScreen &&
["navigation", "screen"].includes($store.selectedComponentId)
$store.selectedComponentId?.startsWith(`${$selectedScreen._id}-`)
) {
return findComponent($selectedScreen?.props, $selectedScreen?.props._id)
return $selectedScreen?.props
}
if (!$selectedScreen || !$store.selectedComponentId) {
return null

View File

@ -1002,7 +1002,6 @@ export const getFrontendStore = () => {
// Check for screen and navigation component edge cases
const screenComponentId = `${screen._id}-screen`
const navComponentId = `${screen._id}-navigation`
console.log(componentId, screenComponentId, navComponentId)
if (componentId === screenComponentId) {
return null
}
@ -1083,7 +1082,6 @@ export const getFrontendStore = () => {
}
},
selectPrevious: () => {
console.log("prev")
const previousId = store.actions.components.getPrevious()
if (previousId) {
store.update(state => {
@ -1093,7 +1091,6 @@ export const getFrontendStore = () => {
}
},
selectNext: () => {
console.log("next")
const nextId = store.actions.components.getNext()
if (nextId) {
store.update(state => {