mirror of https://github.com/tooot-app/app
Fix bugs
This commit is contained in:
parent
3de4212a65
commit
8610be1caf
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tooot",
|
"name": "tooot",
|
||||||
"version": "4.8.1",
|
"version": "4.8.0",
|
||||||
"description": "tooot for Mastodon",
|
"description": "tooot for Mastodon",
|
||||||
"author": "xmflsct <me@xmflsct.com>",
|
"author": "xmflsct <me@xmflsct.com>",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { useAccessibility } from '@utils/accessibility/AccessibilityManager'
|
import { useAccessibility } from '@utils/accessibility/AccessibilityManager'
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import {
|
import {
|
||||||
AccessibilityProps,
|
AccessibilityProps,
|
||||||
Image,
|
Image,
|
||||||
|
@ -59,6 +59,11 @@ const GracefullyImage = ({
|
||||||
const source = {
|
const source = {
|
||||||
uri: reduceMotionEnabled && uri.static ? uri.static : currentUri
|
uri: reduceMotionEnabled && uri.static ? uri.static : currentUri
|
||||||
}
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
if (currentUri !== uri.original && currentUri !== uri.remote) {
|
||||||
|
setCurrentUri(uri.original || uri.remote)
|
||||||
|
}
|
||||||
|
}, [currentUri, uri.original, uri.remote])
|
||||||
|
|
||||||
const blurhashView = () => {
|
const blurhashView = () => {
|
||||||
if (hidden || !imageLoaded) {
|
if (hidden || !imageLoaded) {
|
||||||
|
|
|
@ -55,7 +55,7 @@ const Root: React.FC<NativeStackScreenProps<TabLocalStackParamList, 'Tab-Local-R
|
||||||
: t('tabs.local.name')
|
: t('tabs.local.name')
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{page.page === 'Following' && !pageLocal.showBoosts ? (
|
{page.page === 'Following' && !pageLocal?.showBoosts ? (
|
||||||
<Icon
|
<Icon
|
||||||
name='Repeat'
|
name='Repeat'
|
||||||
size={StyleConstants.Font.Size.M}
|
size={StyleConstants.Font.Size.M}
|
||||||
|
@ -64,7 +64,7 @@ const Root: React.FC<NativeStackScreenProps<TabLocalStackParamList, 'Tab-Local-R
|
||||||
crossOut
|
crossOut
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{page.page === 'Following' && !pageLocal.showReplies ? (
|
{page.page === 'Following' && !pageLocal?.showReplies ? (
|
||||||
<Icon
|
<Icon
|
||||||
name='MessageCircle'
|
name='MessageCircle'
|
||||||
size={StyleConstants.Font.Size.M}
|
size={StyleConstants.Font.Size.M}
|
||||||
|
@ -94,20 +94,20 @@ const Root: React.FC<NativeStackScreenProps<TabLocalStackParamList, 'Tab-Local-R
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
<DropdownMenu.CheckboxItem
|
<DropdownMenu.CheckboxItem
|
||||||
key='showBoosts'
|
key='showBoosts'
|
||||||
value={pageLocal.showBoosts ? 'on' : 'off'}
|
value={pageLocal?.showBoosts ? 'on' : 'off'}
|
||||||
onValueChange={() => {
|
onValueChange={() => {
|
||||||
setQueryKey([
|
setQueryKey([
|
||||||
'Timeline',
|
'Timeline',
|
||||||
{
|
{
|
||||||
page: 'Following',
|
page: 'Following',
|
||||||
showBoosts: !pageLocal.showBoosts,
|
showBoosts: !pageLocal?.showBoosts,
|
||||||
showReplies: pageLocal.showReplies
|
showReplies: pageLocal?.showReplies
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
setAccountStorage([
|
setAccountStorage([
|
||||||
{
|
{
|
||||||
key: 'page_local',
|
key: 'page_local',
|
||||||
value: { ...pageLocal, showBoosts: !pageLocal.showBoosts }
|
value: { ...pageLocal, showBoosts: !pageLocal?.showBoosts }
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}}
|
}}
|
||||||
|
@ -117,20 +117,20 @@ const Root: React.FC<NativeStackScreenProps<TabLocalStackParamList, 'Tab-Local-R
|
||||||
</DropdownMenu.CheckboxItem>
|
</DropdownMenu.CheckboxItem>
|
||||||
<DropdownMenu.CheckboxItem
|
<DropdownMenu.CheckboxItem
|
||||||
key='showReplies'
|
key='showReplies'
|
||||||
value={pageLocal.showReplies ? 'on' : 'off'}
|
value={pageLocal?.showReplies ? 'on' : 'off'}
|
||||||
onValueChange={() => {
|
onValueChange={() => {
|
||||||
setQueryKey([
|
setQueryKey([
|
||||||
'Timeline',
|
'Timeline',
|
||||||
{
|
{
|
||||||
page: 'Following',
|
page: 'Following',
|
||||||
showBoosts: pageLocal.showBoosts,
|
showBoosts: pageLocal?.showBoosts,
|
||||||
showReplies: !pageLocal.showReplies
|
showReplies: !pageLocal?.showReplies
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
setAccountStorage([
|
setAccountStorage([
|
||||||
{
|
{
|
||||||
key: 'page_local',
|
key: 'page_local',
|
||||||
value: { ...pageLocal, showReplies: !pageLocal.showReplies }
|
value: { ...pageLocal, showReplies: !pageLocal?.showReplies }
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -198,16 +198,12 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
||||||
queryClient.setQueryData<{
|
queryClient.setQueryData<{
|
||||||
pages: { body: Mastodon.Status[] }[]
|
pages: { body: Mastodon.Status[] }[]
|
||||||
}>(queryKey.local, old => {
|
}>(queryKey.local, old => {
|
||||||
if (!old) return old
|
|
||||||
|
|
||||||
setHasRemoteContent(true)
|
setHasRemoteContent(true)
|
||||||
return {
|
return {
|
||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
body: data.map(remote => {
|
body: data.map(remote => {
|
||||||
const localMatch = query.data?.pages[0].body.find(
|
const localMatch = old?.pages[0].body.find(local => local.uri === remote.uri)
|
||||||
local => local.uri === remote.uri
|
|
||||||
)
|
|
||||||
if (localMatch) {
|
if (localMatch) {
|
||||||
return { ...localMatch, _level: remote._level }
|
return { ...localMatch, _level: remote._level }
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue