Skip to content

Commit 7e4329e

Browse files
committed
move dev to config
1 parent 6e823eb commit 7e4329e

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

ui/src/components/repo/pod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function getDeck({ id, level }) {
101101
export 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 }) {
761761
function 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);

ui/src/components/repo/sidebar.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff 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>

ui/src/lib/store.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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
},

0 commit comments

Comments
 (0)