|
@@ -1,4 +1,4 @@
|
|
|
-import React, { FC, useEffect, useState } from 'react';
|
|
|
+import React, { FC, useCallback, useEffect, useState } from 'react';
|
|
|
import { ScrollView, Text, TouchableOpacity, View, Image, StyleSheet } from 'react-native';
|
|
|
import { NavigationProp, useFocusEffect } from '@react-navigation/native';
|
|
|
import ImageView from 'react-native-image-viewing';
|
|
@@ -64,17 +64,20 @@ const GroupSettingScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
message: '',
|
|
|
action: () => {}
|
|
|
});
|
|
|
+ const [cacheKey, setCacheKey] = useState(Date.now());
|
|
|
const { mutateAsync: muteGroup } = usePostSetMuteForGroupMutation();
|
|
|
const { mutateAsync: leaveGroup } = usePostLeaveGroupMutation();
|
|
|
const { mutateAsync: removeGroupFromList } = usePostRemoveGroupFromListMutation();
|
|
|
|
|
|
- useFocusEffect(() => {
|
|
|
- navigation.getParent()?.setOptions({
|
|
|
- tabBarStyle: {
|
|
|
- display: 'none'
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ useFocusEffect(
|
|
|
+ useCallback(() => {
|
|
|
+ navigation.getParent()?.setOptions({
|
|
|
+ tabBarStyle: {
|
|
|
+ display: 'none'
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, [token])
|
|
|
+ );
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (data && data.settings) {
|
|
@@ -156,7 +159,9 @@ const GroupSettingScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
token,
|
|
|
groupToken,
|
|
|
refetch,
|
|
|
- refetchMembers
|
|
|
+ refetchMembers,
|
|
|
+ setCacheKey,
|
|
|
+ cacheKey
|
|
|
} as any
|
|
|
});
|
|
|
};
|
|
@@ -195,7 +200,9 @@ const GroupSettingScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
<GroupIcon width={80} height={80} fill={Colors.LIGHT_GRAY} />
|
|
|
) : (
|
|
|
<Image
|
|
|
- source={{ uri: API_HOST + data.settings.avatar, cache: 'reload' }}
|
|
|
+ source={{
|
|
|
+ uri: `${API_HOST}${data.settings.avatar}?cacheBust=${cacheKey}`
|
|
|
+ }}
|
|
|
style={{
|
|
|
width: 80,
|
|
|
height: 80,
|
|
@@ -375,7 +382,7 @@ const GroupSettingScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
title={modalState.title}
|
|
|
/>
|
|
|
<ImageView
|
|
|
- images={[{ uri: API_HOST + data.settings.avatar_full }]}
|
|
|
+ images={[{ uri: `${API_HOST}${data.settings.avatar_full}?cacheBust=${cacheKey}` }]}
|
|
|
keyExtractor={(imageSrc, index) => index.toString()}
|
|
|
imageIndex={0}
|
|
|
visible={fullSizeImageVisible}
|