Skip to content

Commit dcaeb92

Browse files
committed
fix settings
1 parent d264d2d commit dcaeb92

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

open-in-mpv.plugin.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,28 @@ const { React, React: { useState }, Webpack: { Filters, getModule } } = BdApi;
5454

5555
const TheBigBoyBundle = getModule(Filters.byProps("openModal", "FormSwitch", "Anchor"));
5656

57-
function Switch({ value, note, hideBorder, label, key }) {
57+
function Switch({ value, note, hideBorder, label }) {
5858
const [enabled, setEnabled] = useState(value);
5959
return (React.createElement(TheBigBoyBundle.FormSwitch, {
6060
value: enabled, note: note, hideBorder: hideBorder, onChange: e => {
6161
setEnabled(e);
6262

63-
console.log(e);
63+
switch (label) {
64+
case "Show Dialog":
65+
settings.showAgain = e;
66+
break;
67+
default:
68+
break;
69+
}
6470

65-
settings[key] = e;
6671
BdApi.Data.save("open-in-mpv", "settings", settings);
67-
6872
},
6973
}, label));
7074
}
7175

7276
const SettingComponent = () => {
7377
return React.createElement(Switch, {
74-
value: true, /*note: "this is a note",*/ hideBorder: true, onChange: console.log, label: "Show Dialog", key: "showAgain",
78+
value: settings.showAgain, /*note: "this is a note",*/ hideBorder: true, onChange: console.log, label: "Show Dialog"
7579
});
7680
}
7781

0 commit comments

Comments
 (0)