remove wasLoaded hack
This commit is contained in:
parent
b833b34e38
commit
a4a18d2e4b
|
|
@ -25,14 +25,12 @@ function PluginSettingGroupItem({
|
||||||
}) {
|
}) {
|
||||||
// Hide the accordion item if there are no settings for this plugin
|
// Hide the accordion item if there are no settings for this plugin
|
||||||
const [count, setCount] = useState<number>(0);
|
const [count, setCount] = useState<number>(0);
|
||||||
const [wasLoaded, setWasLoaded] = useState<boolean>(false);
|
|
||||||
const [doGet, setDoGet] = useState<boolean>(true);
|
const [doGet, setDoGet] = useState<boolean>(true);
|
||||||
|
|
||||||
// Callback once the plugin settings have been loaded
|
// Callback once the plugin settings have been loaded
|
||||||
const onLoaded = useCallback(
|
const onLoaded = useCallback(
|
||||||
(settings: SettingsStateProps) => {
|
(settings: SettingsStateProps) => {
|
||||||
setCount(settings.getSettingLength());
|
setCount(settings.getSettingLength());
|
||||||
setWasLoaded(true);
|
|
||||||
setDoGet(false);
|
setDoGet(false);
|
||||||
},
|
},
|
||||||
[pluginKey]
|
[pluginKey]
|
||||||
|
|
@ -42,7 +40,7 @@ function PluginSettingGroupItem({
|
||||||
<Accordion.Item
|
<Accordion.Item
|
||||||
key={`plugin-${pluginKey}`}
|
key={`plugin-${pluginKey}`}
|
||||||
value={pluginKey}
|
value={pluginKey}
|
||||||
hidden={count === 0 && wasLoaded}
|
hidden={count === 0}
|
||||||
>
|
>
|
||||||
<Accordion.Control>
|
<Accordion.Control>
|
||||||
<Group justify='space-between'>
|
<Group justify='space-between'>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue