File tree Expand file tree Collapse file tree 3 files changed +22
-15
lines changed
Expand file tree Collapse file tree 3 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ function getDeck({ id, level }) {
101101export function DeckTitle ( { id } ) {
102102 const [ showMenu , setShowMenu ] = useState ( false ) ;
103103 const pod = useSelector ( ( state ) => state . repo . pods [ id ] ) ;
104- const devmode = useSelector ( ( state ) => state . repo . dev ) ;
104+ const devmode = useSelector ( ( state ) => state . repo . repoConfig ?. devMode ) ;
105105 const dispatch = useDispatch ( ) ;
106106 return (
107107 < Box
@@ -761,7 +761,7 @@ function PodDiff({ id, setShowDiff }) {
761761function PodWrapper ( { id, draghandle, children } ) {
762762 // console.log("PodWrapper", id);
763763 const pod = useSelector ( ( state ) => state . repo . pods [ id ] ) ;
764- const devmode = useSelector ( ( state ) => state . repo . dev ) ;
764+ const devmode = useSelector ( ( state ) => state . repo . repoConfig ?. devmode ) ;
765765 const dispatch = useDispatch ( ) ;
766766 const [ showMenu , setShowMenu ] = useState ( false ) ;
767767 const [ showDiff , setShowDiff ] = useState ( false ) ;
Original file line number Diff line number Diff line change @@ -1032,15 +1032,6 @@ function SidebarTest() {
10321032 >
10331033 Unfold All
10341034 </ Button >
1035- < Box >
1036- Dev Mode{ " " }
1037- < Switch
1038- onChange = { ( e ) => {
1039- // console.log(e.target.checked);
1040- dispatch ( repoSlice . actions . setDevMode ( e . target . checked ) ) ;
1041- } }
1042- > </ Switch >
1043- </ Box >
10441035 </ Box >
10451036 ) ;
10461037}
@@ -1123,6 +1114,26 @@ function ConfigButton() {
11231114 } }
11241115 > </ Switch >
11251116 </ Box >
1117+
1118+ < Box >
1119+ Dev Mode{ " " }
1120+ < Switch
1121+ defaultChecked = { repoConfig && repoConfig . devMode }
1122+ onChange = { ( e ) => {
1123+ // console.log(e.target.checked);
1124+ // dispatch(repoSlice.actions.setDevMode(e.target.checked));
1125+ updateRepoConfig ( {
1126+ variables : {
1127+ reponame,
1128+ config : JSON . stringify ( {
1129+ devMode : e . target . checked ,
1130+ } ) ,
1131+ } ,
1132+ } ) ;
1133+ } }
1134+ > </ Switch >
1135+ </ Box >
1136+
11261137 < Button mr = { 3 } onClick = { handleClose } >
11271138 Close
11281139 </ Button >
Original file line number Diff line number Diff line change @@ -125,7 +125,6 @@ const initialState = {
125125 reponame : null ,
126126 username : null ,
127127 repoLoaded : false ,
128- dev : false ,
129128 pods : { } ,
130129 queue : [ ] ,
131130 showdiff : false ,
@@ -163,9 +162,6 @@ export const repoSlice = createSlice({
163162 resetSessionId : ( state , action ) => {
164163 state . sessionId = nanoid ( ) ;
165164 } ,
166- setDevMode : ( state , action ) => {
167- state . dev = action . payload ;
168- } ,
169165 setSessionId : ( state , action ) => {
170166 state . sessionId = action . payload ;
171167 } ,
You can’t perform that action at this time.
0 commit comments