Skip to content

Commit

Permalink
feat: add assets with Swarm copy (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cafe137 authored Jun 20, 2022
1 parent cfd628a commit 77d243c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bee-desktop",
"productName": "bee-desktop",
"productName": "Swarm Desktop",
"author": {
"name": "Swarm",
"email": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion src/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function runDownloader(force = false): Promise<void> {
}
await ensureDir(paths.data)
await ensureAsset(
'https://github.com/ethersphere/bee-desktop-static-maker/releases/download/59d3afab00f22f6cfb10513af35515a9ed4bb38ad63f04d378549bb310d872ec/static.zip',
'https://github.com/ethersphere/bee-desktop-static-maker/releases/download/cd5b019382eb7e18c78c48e4646a2e9a20deac4f7421bb18e67fb68c225afcfa/static.zip',
'static.zip',
{
checkTarget: ['trayTemplate.png', 'static'],
Expand Down
25 changes: 0 additions & 25 deletions src/electron.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { app, Menu, Tray } from 'electron'
import { openDashboardInBrowser, openInstallerInBrowser } from './browser'
import { runDownloader } from './downloader'
import { runLauncher } from './launcher'
import { BeeManager } from './lifecycle'
import { createNotification } from './notify'
Expand All @@ -20,11 +19,6 @@ export function rebuildElectronTray() {
label: 'Open Installer',
click: openInstallerInBrowser,
},
{ type: 'separator' },
{
label: 'Redownload assets',
click: redownloadAssets,
},
{
label: 'Quit',
click: async () => {
Expand Down Expand Up @@ -53,11 +47,6 @@ export function rebuildElectronTray() {
},
},
{ type: 'separator' },
{
label: 'Redownload assets',
click: redownloadAssets,
},
{ type: 'separator' },
{
label: 'Quit',
click: async () => {
Expand Down Expand Up @@ -90,17 +79,3 @@ export function runElectronTray() {
rebuildElectronTray()
})
}

async function redownloadAssets(): Promise<void> {
if (BeeManager.isRunning()) {
BeeManager.stop()
}
await runDownloader(true)
createNotification('New assets fetched successfully')

if (getStatus().hasInitialTransaction) {
runLauncher()
} else {
openInstallerInBrowser()
}
}
2 changes: 1 addition & 1 deletion src/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import envPaths from 'env-paths'
import { existsSync } from 'fs'
import { join } from 'path'

export const paths = envPaths('bee-desktop')
export const paths = envPaths('SwarmDesktop')

export function checkPath(path: string): boolean {
return existsSync(getPath(path))
Expand Down

0 comments on commit 77d243c

Please sign in to comment.