Fix toggling settings.
Explanation: https://github.com/preactjs/preact/issues/3044
This commit is contained in:
parent
18dd962767
commit
58b5192d5a
|
@ -3,7 +3,7 @@
|
|||
"manifest_version": 2,
|
||||
"name": "Tildes ReExtended",
|
||||
"description": "An updated and reimagined recreation of Tildes Extended to enhance and improve the experience of Tildes.net.",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"permissions": [
|
||||
"downloads",
|
||||
"storage",
|
||||
|
|
|
@ -10,19 +10,15 @@ export type SettingProps = {
|
|||
title: string;
|
||||
};
|
||||
|
||||
function toggleFeature(feature: string) {
|
||||
const {toggleFeature: toggle} = useContext(AppContext);
|
||||
toggle(feature);
|
||||
}
|
||||
|
||||
function Header(props: SettingProps): TRXComponent {
|
||||
const context = useContext(AppContext);
|
||||
const enabled = props.enabled ? 'Enabled' : 'Disabled';
|
||||
|
||||
return html`<header>
|
||||
<h2>${props.title}</h2>
|
||||
<button
|
||||
onClick="${() => {
|
||||
toggleFeature(props.feature);
|
||||
context.toggleFeature(props.feature);
|
||||
}}"
|
||||
>
|
||||
${enabled}
|
||||
|
|
Loading…
Reference in New Issue