chore: fixed suspense the right way
This commit is contained in:
parent
6fb563502a
commit
d575910662
1 changed files with 236 additions and 233 deletions
|
@ -148,7 +148,7 @@ const saveConfig = async (
|
|||
return { success: true };
|
||||
};
|
||||
|
||||
function MyConfig() {
|
||||
function config() {
|
||||
const params = useParams();
|
||||
const navigator = useNavigate();
|
||||
const location = useLocation();
|
||||
|
@ -201,7 +201,7 @@ function MyConfig() {
|
|||
});
|
||||
|
||||
const updateValues = createMemo(() => {
|
||||
const guild = payload()?.guild;
|
||||
const guild = !payload.loading && payload()?.guild;
|
||||
if (!guild) return {};
|
||||
const data = config.features.timePlanning;
|
||||
const tpInterval = combineInterval(
|
||||
|
@ -285,6 +285,7 @@ function MyConfig() {
|
|||
});
|
||||
|
||||
return (
|
||||
<Layout site="config">
|
||||
<div class="group">
|
||||
<h3>Configure li'l Judd in</h3>
|
||||
<div>
|
||||
|
@ -351,7 +352,9 @@ function MyConfig() {
|
|||
<p>Time Planning </p>
|
||||
<FontAwesomeIcon
|
||||
icon={
|
||||
config.features.timePlanning.enabled ? faToggleOn : faToggleOff
|
||||
config.features.timePlanning.enabled
|
||||
? faToggleOn
|
||||
: faToggleOff
|
||||
}
|
||||
size="xl"
|
||||
/>
|
||||
|
@ -363,7 +366,12 @@ function MyConfig() {
|
|||
ref={(e) => setTpEnabledRef(e)}
|
||||
checked={!!payload()?.guild.tpChannelId}
|
||||
onInput={(e) =>
|
||||
setConfig("features", "timePlanning", "enabled", e.target.checked)
|
||||
setConfig(
|
||||
"features",
|
||||
"timePlanning",
|
||||
"enabled",
|
||||
e.target.checked,
|
||||
)
|
||||
}
|
||||
/>
|
||||
<div
|
||||
|
@ -451,7 +459,9 @@ function MyConfig() {
|
|||
}
|
||||
>
|
||||
<Index each={Array.from(Array(24)).map((_e, i) => i)}>
|
||||
{(id) => <option value={String(id())}>{String(id())}</option>}
|
||||
{(id) => (
|
||||
<option value={String(id())}>{String(id())}</option>
|
||||
)}
|
||||
</Index>
|
||||
</select>
|
||||
:
|
||||
|
@ -526,13 +536,6 @@ function MyConfig() {
|
|||
</section>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function config() {
|
||||
return (
|
||||
<Layout site="config">
|
||||
<MyConfig />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue