mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-14 18:05:55 +08:00
[offers][fix] Fix save failure message (#474)
This commit is contained in:
@ -1,5 +1,3 @@
|
|||||||
// Import { useState } from 'react';
|
|
||||||
// import { setTimeout } from 'timers';
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { DocumentDuplicateIcon } from '@heroicons/react/20/solid';
|
import { DocumentDuplicateIcon } from '@heroicons/react/20/solid';
|
||||||
import { BookmarkSquareIcon, CheckIcon } from '@heroicons/react/24/outline';
|
import { BookmarkSquareIcon, CheckIcon } from '@heroicons/react/24/outline';
|
||||||
@ -28,11 +26,13 @@ export default function OffersProfileSave({
|
|||||||
{
|
{
|
||||||
onError: () => {
|
onError: () => {
|
||||||
showToast({
|
showToast({
|
||||||
|
subtitle: 'Please check that you are logged in.',
|
||||||
title: `Failed to saved to dashboard!`,
|
title: `Failed to saved to dashboard!`,
|
||||||
variant: 'failure',
|
variant: 'failure',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
|
setSaved(true);
|
||||||
showToast({
|
showToast({
|
||||||
title: `Saved to your dashboard!`,
|
title: `Saved to your dashboard!`,
|
||||||
variant: 'success',
|
variant: 'success',
|
||||||
@ -46,7 +46,6 @@ export default function OffersProfileSave({
|
|||||||
profileId,
|
profileId,
|
||||||
token: token as string,
|
token: token as string,
|
||||||
});
|
});
|
||||||
setSaved(true);
|
|
||||||
gaEvent({
|
gaEvent({
|
||||||
action: 'offers.profile_submission_save_to_profile',
|
action: 'offers.profile_submission_save_to_profile',
|
||||||
category: 'engagement',
|
category: 'engagement',
|
||||||
|
@ -55,6 +55,7 @@ export default function ProfileHeader({
|
|||||||
{
|
{
|
||||||
onError: () => {
|
onError: () => {
|
||||||
showToast({
|
showToast({
|
||||||
|
subtitle: 'Please check that you are logged in.',
|
||||||
title: `Failed to saved to dashboard!`,
|
title: `Failed to saved to dashboard!`,
|
||||||
variant: 'failure',
|
variant: 'failure',
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user