mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Restructure removing remote
This commit is contained in:
@ -7,10 +7,10 @@ import ComposeRoot from '@screens/Compose/Root'
|
||||
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
||||
import { updateStoreReview } from '@utils/slices/contextsSlice'
|
||||
import {
|
||||
getLocalAccount,
|
||||
getLocalMaxTootChar,
|
||||
removeLocalDraft,
|
||||
updateLocalDraft
|
||||
getInstanceAccount,
|
||||
getInstanceMaxTootChar,
|
||||
removeInstanceDraft,
|
||||
updateInstanceDraft
|
||||
} from '@utils/slices/instancesSlice'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
@ -75,7 +75,7 @@ const ScreenCompose: React.FC<ScreenComposeProp> = ({
|
||||
setHasKeyboard(false)
|
||||
}
|
||||
|
||||
const localAccount = useSelector(getLocalAccount, (prev, next) =>
|
||||
const localAccount = useSelector(getInstanceAccount, (prev, next) =>
|
||||
prev?.preferences && next?.preferences
|
||||
? prev?.preferences['posting:default:visibility'] ===
|
||||
next?.preferences['posting:default:visibility']
|
||||
@ -102,7 +102,7 @@ const ScreenCompose: React.FC<ScreenComposeProp> = ({
|
||||
initialReducerState
|
||||
)
|
||||
|
||||
const maxTootChars = useSelector(getLocalMaxTootChar)
|
||||
const maxTootChars = useSelector(getInstanceMaxTootChar, () => true)
|
||||
const totalTextCount =
|
||||
(composeState.spoiler.active ? composeState.spoiler.count : 0) +
|
||||
composeState.text.count
|
||||
@ -158,7 +158,7 @@ const ScreenCompose: React.FC<ScreenComposeProp> = ({
|
||||
|
||||
const saveDraft = () => {
|
||||
dispatch(
|
||||
updateLocalDraft({
|
||||
updateInstanceDraft({
|
||||
timestamp: composeState.timestamp,
|
||||
spoiler: composeState.spoiler.raw,
|
||||
text: composeState.text.raw,
|
||||
@ -171,7 +171,7 @@ const ScreenCompose: React.FC<ScreenComposeProp> = ({
|
||||
)
|
||||
}
|
||||
const removeDraft = useCallback(() => {
|
||||
dispatch(removeLocalDraft(composeState.timestamp))
|
||||
dispatch(removeInstanceDraft(composeState.timestamp))
|
||||
}, [composeState.timestamp])
|
||||
useEffect(() => {
|
||||
const autoSave = composeState.dirty
|
||||
|
Reference in New Issue
Block a user