Remove success toast from Bookmark Button (#11054)

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
RetroSunstar
2026-07-16 16:33:49 +01:00
committed by GitHub
parent b91f5e16bc
commit 54a1d81936
2 changed files with 6 additions and 29 deletions
+1 -1
View File
@@ -282,7 +282,7 @@
"count": 2
},
"typescript/no-misused-promises": {
"count": 2
"count": 1
}
},
"src/components/PostControls/DiscoverDebug.tsx": {
+5 -28
View File
@@ -46,7 +46,7 @@ export const BookmarkButton = memo(function BookmarkButton({
}),
)
const save = async ({disableUndo}: {disableUndo?: boolean} = {}) => {
const save = async () => {
try {
await bookmark({
action: 'create',
@@ -59,25 +59,6 @@ export const BookmarkButton = memo(function BookmarkButton({
logContext,
feedDescriptor,
})
toast.show(
<toast.Outer>
<toast.Icon />
<toast.Text>
<Trans>Post saved</Trans>
</toast.Text>
{!disableUndo && (
<toast.Action
label={undoLabel}
onPress={() => remove({disableUndo: true})}>
{undoLabel}
</toast.Action>
)}
</toast.Outer>,
{
type: 'success',
},
)
} catch (e: any) {
const {raw, clean} = cleanError(e)
toast.show(clean || raw || e, {
@@ -86,7 +67,7 @@ export const BookmarkButton = memo(function BookmarkButton({
}
}
const remove = async ({disableUndo}: {disableUndo?: boolean} = {}) => {
const remove = async () => {
try {
await bookmark({
action: 'delete',
@@ -106,13 +87,9 @@ export const BookmarkButton = memo(function BookmarkButton({
<toast.Text>
<Trans>Removed from saved posts</Trans>
</toast.Text>
{!disableUndo && (
<toast.Action
label={undoLabel}
onPress={() => save({disableUndo: true})}>
{undoLabel}
</toast.Action>
)}
<toast.Action label={undoLabel} onPress={() => save()}>
{undoLabel}
</toast.Action>
</toast.Outer>,
)
} catch (e: any) {