Skip to content

Commit 2d9e639

Browse files
committed
fix settings issue
1 parent 4f4fc14 commit 2d9e639

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

packages/devtool-extenstion/src/containers/App.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@ import NotFoundMessage from "Containers/NotFoundMessage";
77

88
import "./app.scss";
99

10+
const defaultSettings = {
11+
startDebugWhen: "extensionLoad",
12+
debugUseReducer: true,
13+
debugContext: true,
14+
};
15+
1016
const App = ({ appData, onDispatchAction }) => {
1117
const [selectedDebug, setDebug] = useState({});
1218
const [settings, setSettings] = useState({
13-
startDebugWhen: "extensionLoad",
14-
debugUseReducer: true,
15-
debugContext: true,
19+
...defaultSettings,
1620
});
1721

1822
useEffect(() => {
1923
chrome.storage.local.get(
2024
["startDebugWhen", "debugUseReducer", "debugContext"],
2125
function (result) {
22-
setSettings(result);
26+
setSettings({ ...defaultSettings, ...result });
2327
}
2428
);
2529
}, []);

packages/devtool-extenstion/src/containers/Settings/index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
text-align: center;
4444

4545
.success-msg {
46+
text-align: center;
47+
width: 100%;
4648
color: var(--primary-color);
4749
padding-bottom: 10px;
4850
height: 20px;

0 commit comments

Comments
 (0)