Skip to content

Commit

Permalink
pr comments to improve ux
Browse files Browse the repository at this point in the history
  • Loading branch information
nicole-obrien committed May 10, 2024
1 parent 6780bb8 commit 7680ca6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { deleteProfile } from '@contexts/settings/actions'
import { localize } from '@core/i18n'
import { IPersistedProfile } from '@core/profile'
import { PopupId, openPopup } from '@desktop/auxiliary/popup'
import { PopupId, closePopup, openPopup } from '@desktop/auxiliary/popup'
export let profile: IPersistedProfile
Expand All @@ -26,10 +26,13 @@
id: PopupId.Confirmation,
props: {
variant: 'danger',
title: localize('popups.deleteProfile.title'),
title: localize('popups.deleteProfile.title', { name: profile.name }),
alert: { variant: 'warning', text: localize('popups.deleteProfile.confirmation') },
confirmText: localize('actions.delete'),
onConfirm: () => deleteProfile(profile.id),
onConfirm: () => {
deleteProfile(profile.id)
closePopup()
},
},
},
false,
Expand All @@ -48,7 +51,7 @@
{
variant: 'danger',
icon: IconName.Trash,
title: localize('popups.deleteProfile.title'),
title: localize('views.settings.deleteProfile.title'),
onClick: onDeleteClick,
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { logout, removeAllProfileData } from '@core/profile/actions'
import { profiles } from '@core/profile/stores'
import { routerManager } from '@core/router/stores'
import { get } from 'svelte/store'
import { closePopup } from '../../../../../../desktop/lib/auxiliary/popup'

/**
* It removes the active profile from the app's list of profiles, removes the profile's directory from
Expand All @@ -31,7 +30,6 @@ export async function deleteProfile(profileId: string): Promise<void> {
*/
await removeProfileFolder(profileId)

closePopup()
/**
* NOTE: If there are no more profiles, then the user should be
* routed to the welcome screen.
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@
"empty": "The error log is empty."
},
"deleteProfile": {
"title": "Delete profile",
"title": "Delete {name} profile",
"confirmation": "Are you sure you want to delete this profile? This operation cannot be undone.",
"typePassword": "Type your password to confirm."
},
Expand Down

0 comments on commit 7680ca6

Please sign in to comment.