From 44c0a59bdbc72ceba2c8db5a5c6168f57fffbb9e Mon Sep 17 00:00:00 2001 From: Marc Espin Date: Tue, 6 Feb 2024 16:20:35 +0100 Subject: [PATCH] fix: Resolve conflicts in release for desktop shimmer 2.1.12 (#8000) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: Clean electron debris (#7962) * chore(deps): bump follow-redirects from 1.15.2 to 1.15.5 (#7902) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.5. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.5) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Begoña Álvarez de la Cruz * hotfix: macOS notarization (#7995) * fix: Fix macOS Notarization * I hate js * fix workflow --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Begoña Álvarez de la Cruz --- packages/desktop/electron/electronApi.js | 46 ------------------- .../core/app/interfaces/platform.interface.ts | 7 --- .../profile/actions/active-profile/login.ts | 1 - .../profile/actions/active-profile/logout.ts | 2 - .../active-profile/resetActiveProfile.ts | 2 - .../active-profile/setActiveProfile.ts | 2 - .../lib/tests/__mocks__/platform.mock.ts | 11 ----- yarn.lock | 6 +-- 8 files changed, 3 insertions(+), 74 deletions(-) diff --git a/packages/desktop/electron/electronApi.js b/packages/desktop/electron/electronApi.js index 873966fecc7..fe772a10881 100644 --- a/packages/desktop/electron/electronApi.js +++ b/packages/desktop/electron/electronApi.js @@ -7,30 +7,12 @@ const NotificationManager = require('./lib/notificationManager') const { menuState } = require('./lib/menuState') const features = require('../features/features').default -let activeProfileId = null const eventListeners = {} const ElectronApi = { updateAppSettings(settings) { return ipcRenderer.invoke('update-app-settings', settings) }, - getActiveProfile() { - return activeProfileId - }, - updateActiveProfile(id) { - activeProfileId = id - }, - async renameProfileFolder(oldPath, newPath) { - return ipcRenderer.invoke('get-path', 'userData').then((userDataPath) => { - if (oldPath.startsWith(userDataPath)) { - try { - fs.renameSync(oldPath, newPath) - } catch (err) { - console.error(err) - } - } - }) - }, async removeProfileFolder(profilePath) { return ipcRenderer.invoke('get-path', 'userData').then((userDataPath) => { // Check that the removing profile path matches the user data path @@ -82,28 +64,6 @@ const ElectronApi = { return result.filePath }) }, - saveStrongholdBackup: ({ allowAccess }) => null, - async exportTransactionHistory(defaultPath, contents) { - return ipcRenderer - .invoke('show-save-dialog', { - properties: ['createDirectory', 'showOverwriteConfirmation'], - defaultPath, - filters: [{ name: 'CSV Files', extensions: ['csv'] }], - }) - .then((result) => { - if (result.canceled) { - return null - } - return new Promise((resolve, reject) => { - try { - fs.writeFileSync(result.filePath, contents) - resolve(result.filePath) - } catch (err) { - reject(err) - } - }) - }) - }, /** * Gets directory for app's configuration files * @@ -337,12 +297,6 @@ const ElectronApi = { updateTheme(theme) { return ipcRenderer.invoke('update-theme', theme) }, - startLedgerProcess() { - return ipcRenderer.send('start-ledger-process') - }, - killLedgerProcess() { - return ipcRenderer.send('kill-ledger-process') - }, } module.exports = ElectronApi diff --git a/packages/shared/lib/core/app/interfaces/platform.interface.ts b/packages/shared/lib/core/app/interfaces/platform.interface.ts index 7afcb4cd86e..adb1d31d6c4 100644 --- a/packages/shared/lib/core/app/interfaces/platform.interface.ts +++ b/packages/shared/lib/core/app/interfaces/platform.interface.ts @@ -8,17 +8,13 @@ import { AppTheme } from '../enums' export interface IPlatform { getStrongholdBackupDestination(defaultPath: string): Promise - saveStrongholdBackup({ allowAccess }: { allowAccess: boolean }): Promise - exportTransactionHistory(defaultPath: string, contents: string): Promise getUserDataPath(): Promise getDiagnostics(): Promise<{ label: string; value: string }[]> getOS(): Promise getMachineId(): Promise updateAppSettings(settings: Partial): Promise - getActiveProfile(): string updateActiveProfile(id: string): void removeProfileFolder(profilePath: string): Promise - renameProfileFolder(oldPath: string, newPath: string): Promise listProfileFolders(profileStoragePath: string): Promise updateMenu(attribute: string, value: unknown): void popupMenu(): void @@ -55,7 +51,4 @@ export interface IPlatform { getLanguageCode(): Promise updateTheme(theme: AppTheme): void - - startLedgerProcess(): Promise - killLedgerProcess(): Promise } diff --git a/packages/shared/lib/core/profile/actions/active-profile/login.ts b/packages/shared/lib/core/profile/actions/active-profile/login.ts index 105db7b16b2..b3c6bcfd437 100644 --- a/packages/shared/lib/core/profile/actions/active-profile/login.ts +++ b/packages/shared/lib/core/profile/actions/active-profile/login.ts @@ -141,7 +141,6 @@ export async function login(loginOptions?: ILoginOptions): Promise { setTimeStrongholdLastUnlocked() } } else { - Platform.startLedgerProcess() incrementLoginProgress(2) } diff --git a/packages/shared/lib/core/profile/actions/active-profile/logout.ts b/packages/shared/lib/core/profile/actions/active-profile/logout.ts index ad204a1ef33..098f7b064a8 100644 --- a/packages/shared/lib/core/profile/actions/active-profile/logout.ts +++ b/packages/shared/lib/core/profile/actions/active-profile/logout.ts @@ -19,7 +19,6 @@ import { IProfileManager } from '@core/profile-manager/interfaces' import { profileManager } from '@core/profile-manager/stores' import { routerManager } from '@core/router/stores' import { clearFilters } from '@core/utils/clearFilters' -import { Platform } from '@core/app' /** * Logout from active profile @@ -28,7 +27,6 @@ export async function logout(clearActiveProfile = true, _lockStronghold = true): if (get(isSoftwareProfile)) { _lockStronghold && lockStronghold() } else if (isLedgerProfile(get(activeProfile).type)) { - Platform.killLedgerProcess() get(isPollingLedgerDeviceStatus) && stopPollingLedgerNanoStatus() } diff --git a/packages/shared/lib/core/profile/actions/active-profile/resetActiveProfile.ts b/packages/shared/lib/core/profile/actions/active-profile/resetActiveProfile.ts index 941af5cb950..9822696cf1f 100644 --- a/packages/shared/lib/core/profile/actions/active-profile/resetActiveProfile.ts +++ b/packages/shared/lib/core/profile/actions/active-profile/resetActiveProfile.ts @@ -1,10 +1,8 @@ import { activeProfile, activeProfileId, INITIAL_ACTIVE_PROFILE, IProfile } from '@core/profile' -import { Platform } from '@core/app' import { get } from 'svelte/store' export function resetActiveProfile(): void { const { lastUsedAccountIndex } = get(activeProfile) activeProfile.set({ ...INITIAL_ACTIVE_PROFILE, lastUsedAccountIndex }) activeProfileId.set(null) - Platform.updateActiveProfile(null) } diff --git a/packages/shared/lib/core/profile/actions/active-profile/setActiveProfile.ts b/packages/shared/lib/core/profile/actions/active-profile/setActiveProfile.ts index afc670891cc..6e16d960705 100644 --- a/packages/shared/lib/core/profile/actions/active-profile/setActiveProfile.ts +++ b/packages/shared/lib/core/profile/actions/active-profile/setActiveProfile.ts @@ -1,9 +1,7 @@ import { activeProfile, INITIAL_ACTIVE_PROFILE, IPersistedProfile, IProfile } from '@core/profile' import { activeProfileId } from '@core/profile/stores' -import { Platform } from '@core/app' export function setActiveProfile(persistedProfile: IPersistedProfile): void { activeProfile?.set({ ...INITIAL_ACTIVE_PROFILE, ...persistedProfile }) activeProfileId?.set(persistedProfile.id) - Platform.updateActiveProfile(persistedProfile.id) } diff --git a/packages/shared/lib/tests/__mocks__/platform.mock.ts b/packages/shared/lib/tests/__mocks__/platform.mock.ts index b86c0a78def..fa5fb016e71 100644 --- a/packages/shared/lib/tests/__mocks__/platform.mock.ts +++ b/packages/shared/lib/tests/__mocks__/platform.mock.ts @@ -6,12 +6,6 @@ const Platform: IPlatform = { NotificationManager: undefined, PincodeManager: undefined, close(): void {}, - exportTransactionHistory(defaultPath: string, contents: string): Promise { - return Promise.resolve(null) - }, - getActiveProfile(): string { - return '' - }, getDiagnostics(): Promise<{ label: string; value: string }[]> { return Promise.resolve([]) }, @@ -47,16 +41,12 @@ const Platform: IPlatform = { removeProfileFolder(profilePath: string): Promise { return Promise.resolve(undefined) }, - renameProfileFolder(oldPath: string, newPath: string): Promise { - return Promise.resolve(undefined) - }, saveRecoveryKit(kitData: ArrayBuffer): Promise { return Promise.resolve(undefined) }, unhandledException(title: string, err: IError | unknown): Promise { return Promise.resolve(undefined) }, - updateActiveProfile(id: string): void {}, updateAppSettings(settings: Partial): Promise { return Promise.resolve(undefined) }, @@ -97,5 +87,4 @@ const Platform: IPlatform = { updateTheme(): void {}, } -window['__CAPACITOR__'] = Platform window['__ELECTRON__'] = Platform diff --git a/yarn.lock b/yarn.lock index 964d419935c..489ba220294 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4081,9 +4081,9 @@ flatted@^3.1.0: integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== follow-redirects@^1.0.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + version "1.15.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" + integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== for-each@^0.3.3: version "0.3.3"