- {this.renderTab(this.activeTab)}
+ {this.renderTab(this.activeTab)}
@@ -199,6 +216,26 @@ class Dashboard extends Component {
const mapStateToProps = (state, _) => ({
activeTab: state.active.activeTab,
+ get currentRoom(){
+ return state.active.activeRoom;
+ },
+ //this took me way longer to figure out than it should have
+ get allRooms(){
+ if(state.active.activeRoom==-1){
+ return null;
+ }
+ for(let i in state.rooms){
+ if(i==state.active.activeRoom){
+ //console.log("check",state.rooms[i].image)
+ if(state.rooms[i].image===undefined){
+ return null;
+ }else{
+ return state.rooms[i].image;
+ }
+ }
+ }
+ },
+
});
const setActiveTab = (activeTab) => {
diff --git a/smart-hut/src/views/Home.js b/smart-hut/src/views/Home.js
index b5e904f..1347c0a 100644
--- a/smart-hut/src/views/Home.js
+++ b/smart-hut/src/views/Home.js
@@ -247,7 +247,7 @@ const Home = () => (