diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json index f846bb0561..bf1ed59cf4 100644 --- a/oxlint-suppressions.json +++ b/oxlint-suppressions.json @@ -282,7 +282,7 @@ "count": 2 }, "typescript/no-misused-promises": { - "count": 2 + "count": 1 } }, "src/components/PostControls/DiscoverDebug.tsx": { diff --git a/src/components/PostControls/BookmarkButton.tsx b/src/components/PostControls/BookmarkButton.tsx index ba6ad18ff8..b2ed043365 100644 --- a/src/components/PostControls/BookmarkButton.tsx +++ b/src/components/PostControls/BookmarkButton.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( - - - - Post saved - - {!disableUndo && ( - remove({disableUndo: true})}> - {undoLabel} - - )} - , - { - 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({ Removed from saved posts - {!disableUndo && ( - save({disableUndo: true})}> - {undoLabel} - - )} + save()}> + {undoLabel} + , ) } catch (e: any) {