not sure what to do when a channel is archived

This commit is contained in:
Arthur Belleville 2025-07-20 18:39:47 +02:00
parent eb124f6210
commit 527f4a8fb1
No known key found for this signature in database

View file

@ -31,7 +31,6 @@ const ACTION_WIDTH = 80;
export const SwipeableChannelPreview: React.FC<
SwipeableChannelPreviewProps
> = ({ channel, children }) => {
const id = channel.id ?? "";
const translateX = useSharedValue(0);
const handleArchiveChannel = async () => {
@ -52,25 +51,25 @@ export const SwipeableChannelPreview: React.FC<
{
text: "Archiver",
style: "destructive",
onPress: async () => {
try {
// Hide the channel for the current user
await channel.hide();
// onPress: async () => {
// try {
// // Hide the channel for the current user
// await channel.hide();
// Close the swipe action
translateX.value = withSpring(0);
// // Close the swipe action
// translateX.value = withSpring(0);
// Show success message
Alert.alert(
"Succès",
"La conversation a été archivée avec succès",
[{ text: "OK" }]
);
} catch (error) {
console.error("Error archiving channel:", error);
Alert.alert("Erreur", "Impossible d'archiver la conversation");
}
},
// // Show success message
// Alert.alert(
// "Succès",
// "La conversation a été archivée avec succès",
// [{ text: "OK" }]
// );
// } catch (error) {
// console.error("Error archiving channel:", error);
// Alert.alert("Erreur", "Impossible d'archiver la conversation");
// }
// },
},
],
{ cancelable: true }