Fix empty screen list when deleting a table backing an autoscreen which is currently selected
This commit is contained in:
parent
52dd9760c5
commit
ce917b5005
|
@ -85,7 +85,9 @@ export const getFrontendStore = () => {
|
||||||
screens: {
|
screens: {
|
||||||
select: screenId => {
|
select: screenId => {
|
||||||
store.update(state => {
|
store.update(state => {
|
||||||
const screen = get(allScreens).find(screen => screen._id === screenId)
|
let screens = get(allScreens)
|
||||||
|
let screen =
|
||||||
|
screens.find(screen => screen._id === screenId) || screens[0]
|
||||||
if (!screen) return state
|
if (!screen) return state
|
||||||
state.currentFrontEndType = FrontendTypes.SCREEN
|
state.currentFrontEndType = FrontendTypes.SCREEN
|
||||||
state.currentAssetId = screen._id
|
state.currentAssetId = screen._id
|
||||||
|
|
Loading…
Reference in New Issue