not sure what to do when a channel is archived
This commit is contained in:
parent
eb124f6210
commit
527f4a8fb1
1 changed files with 17 additions and 18 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Reference in a new issue