split thunks from slices to avoid circular dependencies

This commit is contained in:
Athou
2023-12-28 22:11:03 +01:00
parent bb4bb0c7d7
commit 0ea0db48db
41 changed files with 460 additions and 413 deletions

View File

@@ -1,6 +1,8 @@
import { Trans } from "@lingui/macro"
import { Divider, Select, SimpleGrid, Stack, Switch } from "@mantine/core"
import { Constants } from "app/constants"
import { useAppDispatch, useAppSelector } from "app/store"
import { type SharingSettings } from "app/types"
import {
changeAlwaysScrollToEntry,
changeCustomContextMenu,
@@ -10,9 +12,7 @@ import {
changeScrollSpeed,
changeSharingSetting,
changeShowRead,
} from "app/slices/user"
import { useAppDispatch, useAppSelector } from "app/store"
import { type SharingSettings } from "app/types"
} from "app/user/thunks"
import { locales } from "i18n"
export function DisplaySettings() {
@@ -82,7 +82,14 @@ export function DisplaySettings() {
key={site}
label={Constants.sharing[site].label}
checked={sharingSettings && sharingSettings[site]}
onChange={async e => await dispatch(changeSharingSetting({ site, value: e.currentTarget.checked }))}
onChange={async e =>
await dispatch(
changeSharingSetting({
site,
value: e.currentTarget.checked,
})
)
}
/>
))}
</SimpleGrid>