Skip to content

Commit f35309e

Browse files
author
cpl121
committed
refactor: login WIP
1 parent f7cfffb commit f35309e

File tree

66 files changed

+269
-283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+269
-283
lines changed

packages/desktop/components/modals/WalletActionsMenu.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// $selectedWallet?.id === $activeWallets?.length - 1 && $visibleActiveWallets?.length > 1
2121
2222
function onCustomiseAccountClick(): void {
23-
openPopup({ id: PopupId.ManageAccount })
23+
openPopup({ id: PopupId.ManageWallet })
2424
modal?.close()
2525
}
2626

packages/desktop/components/popups/AddNodePopup.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { showAppNotification } from '@auxiliary/notification'
66
import { closePopup } from '@auxiliary/popup'
77
import { Platform } from '@core/app'
8-
import { activeAccounts, activeProfile } from '@core/profile'
8+
import { activeWallets, activeProfile } from '@core/profile'
99
import { registerProposalsForAccounts } from '@contexts/governance'
1010
1111
export let node: INode = structuredClone(EMPTY_NODE)
@@ -33,7 +33,7 @@
3333
}
3434
3535
if (Platform.isFeatureFlagEnabled('governance')) {
36-
await registerProposalsForAccounts({ node }, $activeAccounts)
36+
await registerProposalsForAccounts({ node }, $activeWallets)
3737
}
3838
3939
onSuccess()

packages/desktop/components/popups/AddProposalPopup.svelte

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script lang="ts">
22
import { showAppNotification } from '@auxiliary/notification/actions'
33
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
4-
import { registerProposalsForAccounts, registeredProposalsForSelectedWallet } from '@contexts/governance'
4+
import { registerProposalsForWallets, registeredProposalsForSelectedWallet } from '@contexts/governance'
55
import { selectedWallet } from '@core/wallet'
66
import { handleError } from '@core/error/handlers/handleError'
77
import { localize } from '@core/i18n'
8-
import { activeAccounts, updateActiveAccountPersistedData } from '@core/profile'
8+
import { activeWallets, updateActiveWalletPersistedData } from '@core/profile'
99
import { truncateString } from '@core/utils/string'
1010
import type { Auth } from '@iota/sdk/out/types'
1111
import { Button, Checkbox, NodeInput, Text, TextInput, TextType } from 'shared/components'
@@ -21,7 +21,7 @@
2121
let nodeInputError: string
2222
let isBusy = false
2323
let isRegisteringAllProposals = false
24-
let isAddingForAllAccounts = false
24+
let isAddingForAllWallets = false
2525
2626
$: isEditMode = !!initialEventId && !!initialNodeUrl
2727
$: disabled = isBusy || !nodeUrl || (!isRegisteringAllProposals && !eventId)
@@ -35,11 +35,11 @@
3535
try {
3636
isBusy = true
3737
await Promise.all([
38-
!isRegisteringAllProposals && validateEventId(!isAddingForAllAccounts && !isEditMode),
38+
!isRegisteringAllProposals && validateEventId(!isAddingForAllWallets && !isEditMode),
3939
nodeInput?.validate(),
4040
])
4141
await registerParticipationWrapper()
42-
updateActiveAccountPersistedData($selectedWallet.id, {
42+
updateActiveWalletPersistedData($selectedWallet.id, {
4343
removedProposalIds: $selectedWallet.removedProposalIds?.filter((id) => id !== inputtedEventId),
4444
})
4545
isBusy = false
@@ -82,8 +82,8 @@
8282
node: { url: nodeUrl, auth },
8383
eventsToRegister: isRegisteringAllProposals ? [] : [eventId],
8484
}
85-
const accounts = isAddingForAllAccounts ? $activeAccounts : [$selectedWallet]
86-
await registerProposalsForAccounts(options, accounts)
85+
const wallets = isAddingForAllWallets ? $activeWallets : [$selectedWallet]
86+
await registerProposalsForWallets(options, wallets)
8787
showAppNotification({
8888
type: 'success',
8989
message: generateSuccessMessage(),
@@ -96,7 +96,7 @@
9696
if (isEditMode) {
9797
return localize('views.governance.proposals.successEdit')
9898
} else {
99-
return localize(`views.governance.proposals.${isAddingForAllAccounts ? 'successAddAll' : 'successAdd'}`, {
99+
return localize(`views.governance.proposals.${isAddingForAllWallets ? 'successAddAll' : 'successAdd'}`, {
100100
values: { numberOfProposals: isRegisteringAllProposals ? 'other' : 'one' },
101101
})
102102
}
@@ -139,7 +139,7 @@
139139
label={localize('views.governance.details.proposalInformation.eventId')}
140140
/>
141141
{#if !isEditMode}
142-
<Checkbox label={localize('popups.addProposal.addToAllAccounts')} bind:checked={isAddingForAllAccounts} />
142+
<Checkbox label={localize('popups.addProposal.addToAllAccounts')} bind:checked={isAddingForAllWallets} />
143143
{/if}
144144
</div>
145145
<div class="flex w-full space-x-4 mt-6">

packages/desktop/components/popups/CreateWalletPopup.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<Input
7474
{error}
7575
bind:value={accountAlias}
76-
placeholder={localize('general.accountName')}
76+
placeholder={localize('general.walletName')}
7777
autofocus
7878
submitHandler={onCreateClick}
7979
disabled={isBusy}

packages/desktop/components/popups/ManageAccountPopup.svelte renamed to packages/desktop/components/popups/ManageWalletPopup.svelte

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
<script lang="ts">
22
import { closePopup } from '@auxiliary/popup'
33
import { localize } from '@core/i18n'
4-
import { updateActiveAccountPersistedData } from '@core/profile/actions'
4+
import { updateActiveWalletPersistedData } from '@core/profile/actions'
55
import { getTrimmedLength } from '@core/utils'
66
import { selectedWallet, validateWalletName } from '@core/wallet'
77
import { Button, ColorPicker, Input, Text, TextType } from '@ui'
88
99
export let error = ''
1010
1111
let isBusy = false
12-
let accountAlias = $selectedWallet.name
12+
let walletAlias = $selectedWallet.name
1313
let color = $selectedWallet.color
1414
15-
$: accountAlias, (error = '')
16-
$: trimmedAccountAlias = accountAlias.trim()
17-
$: invalidAliasUpdate = !getTrimmedLength(accountAlias) || isBusy || accountAlias === $selectedWallet.name
15+
$: walletAlias, (error = '')
16+
$: trimmedWalletAlias = walletAlias.trim()
17+
$: invalidAliasUpdate = !getTrimmedLength(walletAlias) || isBusy || walletAlias === $selectedWallet.name
1818
$: hasColorChanged = $selectedWallet.color !== color
1919
2020
async function onSaveClick(): Promise<void> {
21-
if (trimmedAccountAlias) {
21+
if (trimmedWalletAlias) {
2222
error = ''
2323
try {
24-
await validateWalletName(trimmedAccountAlias, true, trimmedAccountAlias !== $selectedWallet.name)
24+
await validateWalletName(trimmedWalletAlias, true, trimmedWalletAlias !== $selectedWallet.name)
2525
} catch ({ message }) {
2626
error = message
2727
return
2828
}
2929
3030
isBusy = true
31-
saveAccountPersistedData()
31+
saveWalletPersistedData()
3232
}
3333
}
3434
3535
function onCancelClick(): void {
3636
closePopup()
3737
}
3838
39-
function saveAccountPersistedData(): void {
39+
function saveWalletPersistedData(): void {
4040
try {
41-
if (trimmedAccountAlias || color) {
42-
updateActiveAccountPersistedData($selectedWallet?.id, { name: trimmedAccountAlias, color })
41+
if (trimmedWalletAlias || color) {
42+
updateActiveWalletPersistedData($selectedWallet?.id, { name: trimmedWalletAlias, color })
4343
closePopup()
4444
}
4545
} finally {
@@ -51,13 +51,13 @@
5151
<manage-account-popup class="flex flex-col h-full justify-between space-y-4">
5252
<div>
5353
<title-container class="flex flex-row mb-6">
54-
<Text type={TextType.h5}>{localize('general.manageAccount')}</Text>
54+
<Text type={TextType.h5}>{localize('general.manageWallet')}</Text>
5555
</title-container>
5656
<manage-account-popup-inputs class="w-full flex flex-col justify-between space-y-4">
5757
<Input
5858
{error}
59-
bind:value={accountAlias}
60-
placeholder={localize('general.accountName')}
59+
bind:value={walletAlias}
60+
placeholder={localize('general.walletName')}
6161
autofocus
6262
submitHandler={onSaveClick}
6363
disabled={isBusy}

packages/desktop/components/popups/Popup.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import LedgerAppGuidePopup from './LedgerAppGuidePopup.svelte'
3131
import LedgerConnectionGuidePopup from './LedgerConnectionGuidePopup.svelte'
3232
import LegalUpdatePopup from './LegalUpdatePopup.svelte'
33-
import ManageAccountPopup from './ManageAccountPopup.svelte'
33+
import ManageWalletPopup from './ManageWalletPopup.svelte'
3434
import ManageVotingPowerPopup from './ManageVotingPowerPopup.svelte'
3535
import MintNativeTokenConfirmationPopup from './MintNativeTokenConfirmationPopup.svelte'
3636
import MintNativeTokenFormPopup from './MintNativeTokenFormPopup.svelte'
@@ -79,7 +79,7 @@
7979
$: switch (id) {
8080
case PopupId.ConnectLedger:
8181
case PopupId.createWallet:
82-
case PopupId.ManageAccount:
82+
case PopupId.ManageWallet:
8383
size = PopupSize.Small
8484
break
8585
case PopupId.LedgerAppGuide:
@@ -116,7 +116,7 @@
116116
[PopupId.LedgerAppGuide]: LedgerAppGuidePopup,
117117
[PopupId.LedgerConnection]: LedgerConnectionGuidePopup,
118118
[PopupId.LegalUpdate]: LegalUpdatePopup,
119-
[PopupId.ManageAccount]: ManageAccountPopup,
119+
[PopupId.ManageWallet]: ManageWalletPopup,
120120
[PopupId.ManageVotingPower]: ManageVotingPowerPopup,
121121
[PopupId.MetricSystemInfo]: MetricSystemInfoPopup,
122122
[PopupId.MintNativeTokenConfirmation]: MintNativeTokenConfirmationPopup,

packages/desktop/components/popups/RemoveProposalPopup.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import { selectedWallet } from '@core/wallet/stores'
1212
import { handleError } from '@core/error/handlers'
1313
import { localize } from '@core/i18n'
14-
import { updateActiveAccountPersistedData } from '@core/profile/actions'
14+
import { updateActiveWalletPersistedData } from '@core/profile/actions'
1515
import { governanceRouter } from '@core/router'
1616
import { Button, Text, TextHint, TextType } from 'shared/components'
1717
import { ButtonVariant, TextHintVariant } from 'shared/components/enums'
@@ -23,7 +23,7 @@
2323
async function onConfirmClick(): Promise<void> {
2424
try {
2525
await $selectedWallet.deregisterParticipationEvent($selectedProposalId)
26-
updateActiveAccountPersistedData($selectedWallet.id, {
26+
updateActiveWalletPersistedData($selectedWallet.id, {
2727
removedProposalIds: [...($selectedWallet.removedProposalIds ?? []), $selectedProposalId],
2828
})
2929
$governanceRouter.previous()

packages/desktop/views/login/views/SelectProfileView.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
async function onAddProfileClick(): Promise<void> {
3232
onboardingRouter.set(new OnboardingRouter())
3333
await initialiseOnboardingProfile(shouldBeDeveloperProfile())
34-
console.log("shuld be created")
3534
$routerManager.goToAppContext(AppContext.Onboarding)
3635
}
3736

packages/desktop/views/onboarding/views/complete-onboarding/views/FinishOnboardingView.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
}
2929
3030
async function _continue(): Promise<void> {
31-
console.log($onboardingProfile)
3231
// Note: needed to cover the cases where the user has waited so long that the stronghold is locked
3332
if ($onboardingProfile?.restoreProfileType === RestoreProfileType.Stronghold) {
3433
await setStrongholdPassword($onboardingProfile.strongholdPassword)

packages/desktop/views/onboarding/views/create-profile/views/ChooseCreateProfileFlowView.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
const type = createProfileType === CreateProfileType.Ledger ? ProfileType.Ledger : ProfileType.Software
2929
const storagePath = await getStorageDirectoryOfProfile($onboardingProfile.id)
3030
const secretManagerOptions = getSecretManagerFromProfileType(type, storagePath)
31-
console.log("secretManagerOptions", secretManagerOptions)
3231
updateOnboardingProfile({ createProfileType, type, secretManagerOptions })
3332
$createProfileRouter.next()
3433
}

0 commit comments

Comments
 (0)