Skip to content

Commit

Permalink
fix: Resolve conflicts in release for desktop shimmer 2.1.12 (#8000)
Browse files Browse the repository at this point in the history
* 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](follow-redirects/follow-redirects@v1.15.2...v1.15.5)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Begoña Álvarez de la Cruz <balvarez@boxfish.studio>

* hotfix: macOS notarization (#7995)

* fix: Fix macOS Notarization

* I hate js

* fix workflow

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Begoña Álvarez de la Cruz <balvarez@boxfish.studio>
  • Loading branch information
3 people authored Feb 6, 2024
1 parent 6b08a4f commit 44c0a59
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 74 deletions.
46 changes: 0 additions & 46 deletions packages/desktop/electron/electronApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
7 changes: 0 additions & 7 deletions packages/shared/lib/core/app/interfaces/platform.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ import { AppTheme } from '../enums'

export interface IPlatform {
getStrongholdBackupDestination(defaultPath: string): Promise<string | null>
saveStrongholdBackup({ allowAccess }: { allowAccess: boolean }): Promise<void>
exportTransactionHistory(defaultPath: string, contents: string): Promise<string | null>
getUserDataPath(): Promise<string>
getDiagnostics(): Promise<{ label: string; value: string }[]>
getOS(): Promise<string>
getMachineId(): Promise<string>
updateAppSettings(settings: Partial<IAppSettings>): Promise<void>
getActiveProfile(): string
updateActiveProfile(id: string): void
removeProfileFolder(profilePath: string): Promise<void>
renameProfileFolder(oldPath: string, newPath: string): Promise<void>
listProfileFolders(profileStoragePath: string): Promise<string[]>
updateMenu(attribute: string, value: unknown): void
popupMenu(): void
Expand Down Expand Up @@ -55,7 +51,4 @@ export interface IPlatform {

getLanguageCode(): Promise<string>
updateTheme(theme: AppTheme): void

startLedgerProcess(): Promise<void>
killLedgerProcess(): Promise<void>
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export async function login(loginOptions?: ILoginOptions): Promise<void> {
setTimeStrongholdLastUnlocked()
}
} else {
Platform.startLedgerProcess()
incrementLoginProgress(2)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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(<IProfile>{ ...INITIAL_ACTIVE_PROFILE, lastUsedAccountIndex })
activeProfileId.set(null)
Platform.updateActiveProfile(null)
}
Original file line number Diff line number Diff line change
@@ -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(<IProfile>{ ...INITIAL_ACTIVE_PROFILE, ...persistedProfile })
activeProfileId?.set(persistedProfile.id)
Platform.updateActiveProfile(persistedProfile.id)
}
11 changes: 0 additions & 11 deletions packages/shared/lib/tests/__mocks__/platform.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ const Platform: IPlatform = {
NotificationManager: undefined,
PincodeManager: undefined,
close(): void {},
exportTransactionHistory(defaultPath: string, contents: string): Promise<string | null> {
return Promise.resolve(null)
},
getActiveProfile(): string {
return ''
},
getDiagnostics(): Promise<{ label: string; value: string }[]> {
return Promise.resolve([])
},
Expand Down Expand Up @@ -47,16 +41,12 @@ const Platform: IPlatform = {
removeProfileFolder(profilePath: string): Promise<void> {
return Promise.resolve(undefined)
},
renameProfileFolder(oldPath: string, newPath: string): Promise<void> {
return Promise.resolve(undefined)
},
saveRecoveryKit(kitData: ArrayBuffer): Promise<void> {
return Promise.resolve(undefined)
},
unhandledException(title: string, err: IError | unknown): Promise<void> {
return Promise.resolve(undefined)
},
updateActiveProfile(id: string): void {},
updateAppSettings(settings: Partial<IAppSettings>): Promise<void> {
return Promise.resolve(undefined)
},
Expand Down Expand Up @@ -97,5 +87,4 @@ const Platform: IPlatform = {
updateTheme(): void {},
}

window['__CAPACITOR__'] = Platform
window['__ELECTRON__'] = Platform
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 44c0a59

Please sign in to comment.