Remove success toast from Bookmark Button (#11054)
Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -282,7 +282,7 @@
|
||||
"count": 2
|
||||
},
|
||||
"typescript/no-misused-promises": {
|
||||
"count": 2
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"src/components/PostControls/DiscoverDebug.tsx": {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user