Son
Son
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Son on 9/23/2024 in #questions
React Native: ScrollView of Text Components not scrolling on Android But it is working on iOS
i have this exact issue: https://stackoverflow.com/questions/75830711/react-native-scrollview-of-text-components-not-scrolling-on-android-but-it-is-w my text content is scrollable in IOS but not in android. my code:
IS_ANDROID && (<View style = {{
maxHeight : 200,
minHeight : 100,
}}><ScrollView contentContainerStyle = {{
flexGrow : 1,
backgroundColor : "red",
}}><Text style = {{
fontSize : 18,
fontFamily : "ggRegular",
color : theme.raw.colors.lead,
}}>{value} < / Text >
</ ScrollView>
</ View>)
}
IS_ANDROID && (<View style = {{
maxHeight : 200,
minHeight : 100,
}}><ScrollView contentContainerStyle = {{
flexGrow : 1,
backgroundColor : "red",
}}><Text style = {{
fontSize : 18,
fontFamily : "ggRegular",
color : theme.raw.colors.lead,
}}>{value} < / Text >
</ ScrollView>
</ View>)
}
1 replies
TTCTheo's Typesafe Cult
Created by Son on 5/24/2024 in #questions
expo app production logging solutions
Hey, What are the axiom (logging) sentry.io (error logging) equivalents for expo apps?
8 replies
TTCTheo's Typesafe Cult
Created by Son on 4/4/2024 in #questions
User Privacy Question
Say i have an app which the premise that it offers a safe place for users to “log” sensitive personal data they might not want the world to know about their commitments to various things. Over the long run I would want to organise manage and use this data for many purposes, one being to approach individuals who meet whatever criteria i have set up according to the data. Maybe to sell them services or learn from them. How would one go about user anonymity but still be able to link “logs” to users. Is this feasible? I would like to say “your logs are encrypted and cannot be read by just anyone” but at the end of the day an engineer would be able to link the user to their data by decryption. Is this acceptablet?
18 replies
TTCTheo's Typesafe Cult
Created by Son on 10/18/2023 in #questions
Can you programmatically reload an expo app?
I have to re-initialize a data structure in my expo managed app (SDK 49) so i need to reload the app. Everything works in development (IOS dev build) , i hit a button and the app reloads. But in production, nothing happens. Is there anything i need to do differently in production I’m only using this function to manually reload the app not to deliver any updates just yet. Updates.reloadAsync() from expo-updates i keep getting code ERR_FUNCTION_CALL in production, my code:
setTimeout(() => {

(async () => {
if (__DEV__) {
DevSettings.reload()
return
}
try {
const res = await Updates.reloadAsync()
console.log('res',res)
Alert.alert('res',JSON.stringify(res))
} catch (error) {
Alert.alert('error',JSON.stringify(error))
}
})();

},100);
setTimeout(() => {

(async () => {
if (__DEV__) {
DevSettings.reload()
return
}
try {
const res = await Updates.reloadAsync()
console.log('res',res)
Alert.alert('res',JSON.stringify(res))
} catch (error) {
Alert.alert('error',JSON.stringify(error))
}
})();

},100);
2 replies
TTCTheo's Typesafe Cult
Created by Son on 5/19/2023 in #questions
Are sever components running on an actual sever? Can someone explain?
Next js question. Why can’t we import sever components into client components directly? I know we can pass sever components as props, but why only this way? And are the actual sever components running on an actual sever? Can someone explain?
8 replies
TTCTheo's Typesafe Cult
Created by Son on 1/31/2023 in #questions
I have an infinite loop within my hook but app works as expected, i'm confused...
when i console log inside this hook, it repeats non-stop every few seconds, but my app is working as expected there is no infinite loop per say. i'm really confused with this one.
import zustand from ...

export function useGetTickets(tenantId?: any) {
const setTickets = useTicketStore((state) => state.setTickets);
const isApiError = useTicketStore((state) => state.isApiError);
const setIsApiError = useTicketStore((state) => state.setIsApiError);

const { isLoading, isError, data } =
trpc.getTicketsWithPhotos.getAll.useQuery(undefined, {
onSuccess: (data) => {
console.log("data", data);
setIsApiError(false);
setTickets(data.tickets);
},
onError: (e) => {
showToastCustomError(
"Sever Error",
"We cannot connect to our servers, please try again later or contact support",
8000
);
setIsApiError(true);
return console.error(e.message);
},
});

return { data, isLoading, isApiError };
}
import zustand from ...

export function useGetTickets(tenantId?: any) {
const setTickets = useTicketStore((state) => state.setTickets);
const isApiError = useTicketStore((state) => state.isApiError);
const setIsApiError = useTicketStore((state) => state.setIsApiError);

const { isLoading, isError, data } =
trpc.getTicketsWithPhotos.getAll.useQuery(undefined, {
onSuccess: (data) => {
console.log("data", data);
setIsApiError(false);
setTickets(data.tickets);
},
onError: (e) => {
showToastCustomError(
"Sever Error",
"We cannot connect to our servers, please try again later or contact support",
8000
);
setIsApiError(true);
return console.error(e.message);
},
});

return { data, isLoading, isApiError };
}
3 replies
TTCTheo's Typesafe Cult
Created by Son on 1/27/2023 in #questions
Expo-Camera Bug Affecting Android only
1 replies
TTCTheo's Typesafe Cult
Created by Son on 11/21/2022 in #questions
TRPC Testing Wrapper - Unit Testing components that contain a query (Not testing the query it self)
9 replies
TTCTheo's Typesafe Cult
Created by Son on 11/20/2022 in #questions
Next Auth Discord Callback error...
27 replies
TTCTheo's Typesafe Cult
Created by Son on 11/19/2022 in #questions
T3 Docs - code explanation
import { DefaultSession } from "next-auth";

declare module "next-auth" {
interface Session {
user?: {
id: string;
} & DefaultSession["user"];
}
}
import { DefaultSession } from "next-auth";

declare module "next-auth" {
interface Session {
user?: {
id: string;
} & DefaultSession["user"];
}
}
can some one explain to me whst & DefaultSession["user"] is doing?
2 replies
TTCTheo's Typesafe Cult
Created by Son on 11/16/2022 in #questions
Noob Q - Prisma date property
7 replies
TTCTheo's Typesafe Cult
Created by Son on 11/15/2022 in #questions
noob question - expo react native - react navigation modal issue
I need help with react-navigation’s modal component. At the moment the modal opens in front of the screen from which it is called from which is what i want. But when i close it, it does not refresh the screen from where it was called from via use navigation.goBack(). This makes sense as the screen is not destroyed. It sits behind the modal, But that screens data is being updated via the model so i need it to reflect that update immediately upon the modal closing. I’m using react query. Can anyone help. The screen does not refresh upon the modal closing is there a way to force this behaviour?
1 replies
TTCTheo's Typesafe Cult
Created by Son on 11/11/2022 in #questions
object updating incorrectly
2 replies
TTCTheo's Typesafe Cult
Created by Son on 11/9/2022 in #questions
How do I access onSuccess with TRPC client side?
We can do it with react query quite simply, but i don't see a documentation on it with trpc. if the request is succesful i want to save the data to global state via zustand. I need the onSuccess to do it i believe.
const tickets = trpc.ticketService.getByTenantId.useQuery()
const tickets = trpc.ticketService.getByTenantId.useQuery()
this does not work
React.useEffect(() => {
if (tickets.data) {
setTickets(tickets.data);
}
console.log('all tickets', allTickets);
}, [tickets.data]);
React.useEffect(() => {
if (tickets.data) {
setTickets(tickets.data);
}
console.log('all tickets', allTickets);
}, [tickets.data]);
19 replies