Skip to content

Commit 0c1f9ca

Browse files
authored
fix: added default value in useUserPreferences (#6855)
* Added default value in useUserPreferences * it was false ;-; * added for auto play image
1 parent 6250fd7 commit 0c1f9ca

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

app/containers/ImageViewer/ImageViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const styles = StyleSheet.create({
3030
});
3131

3232
export const ImageViewer = ({ uri = '', width, height, ...props }: ImageViewerProps): React.ReactElement => {
33-
const [autoplayGifs] = useUserPreferences<boolean>(AUTOPLAY_GIFS_PREFERENCES_KEY);
33+
const [autoplayGifs] = useUserPreferences<boolean>(AUTOPLAY_GIFS_PREFERENCES_KEY, true);
3434
const [isPlaying, setIsPlaying] = useState<boolean>(!!autoplayGifs);
3535
const expoImageRef = useRef<Image>(null);
3636

app/containers/markdown/components/mentions/AtMention.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface IAtMention {
2020

2121
const AtMention = React.memo(({ mention, mentions, username, navToRoomInfo, style = [], useRealName }: IAtMention) => {
2222
const { theme } = useTheme();
23-
const [mentionsWithAtSymbol] = useUserPreferences<boolean>(USER_MENTIONS_PREFERENCES_KEY);
23+
const [mentionsWithAtSymbol] = useUserPreferences<boolean>(USER_MENTIONS_PREFERENCES_KEY, false);
2424
const preffix = mentionsWithAtSymbol ? '@' : '';
2525
if (mention === 'all' || mention === 'here') {
2626
return (

app/containers/markdown/components/mentions/Hashtag.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface IHashtag {
2424

2525
const Hashtag = React.memo(({ hashtag, channels, navToRoomInfo, style = [] }: IHashtag) => {
2626
const { theme } = useTheme();
27-
const [roomsWithHashTagSymbol] = useUserPreferences<boolean>(ROOM_MENTIONS_PREFERENCES_KEY);
27+
const [roomsWithHashTagSymbol] = useUserPreferences<boolean>(ROOM_MENTIONS_PREFERENCES_KEY, false);
2828
const isMasterDetail = useAppSelector(state => state.app.isMasterDetail);
2929
const preffix = roomsWithHashTagSymbol ? '#' : '';
3030
const handlePress = async () => {

app/views/AccessibilityAndAppearanceView/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export type TAlertDisplayType = 'TOAST' | 'DIALOG';
2323
const AccessibilityAndAppearanceView = () => {
2424
const navigation = useNavigation<NativeStackNavigationProp<AccessibilityStackParamList>>();
2525
const isMasterDetail = useAppSelector(state => state.app.isMasterDetail as boolean);
26-
const [mentionsWithAtSymbol, setMentionsWithAtSymbol] = useUserPreferences<boolean>(USER_MENTIONS_PREFERENCES_KEY);
27-
const [roomsWithHashTagSymbol, setRoomsWithHashTagSymbol] = useUserPreferences<boolean>(ROOM_MENTIONS_PREFERENCES_KEY);
26+
const [mentionsWithAtSymbol, setMentionsWithAtSymbol] = useUserPreferences<boolean>(USER_MENTIONS_PREFERENCES_KEY, false);
27+
const [roomsWithHashTagSymbol, setRoomsWithHashTagSymbol] = useUserPreferences<boolean>(ROOM_MENTIONS_PREFERENCES_KEY, false);
2828
const [autoplayGifs, setAutoplayGifs] = useUserPreferences<boolean>(AUTOPLAY_GIFS_PREFERENCES_KEY, true);
2929
const [alertDisplayType, setAlertDisplayType] = useUserPreferences<TAlertDisplayType>(
3030
ALERT_DISPLAY_TYPE_PREFERENCES_KEY,

0 commit comments

Comments
 (0)