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