Skip to content

Commit

Permalink
fix: don't pass ctx. individual fns use what is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Aug 22, 2023
1 parent e239768 commit c11104a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/move-repository-location.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ const logger = require('./common/logger')
const { showDialog, recoverableErrorDialog, selectDirectory } = require('./dialogs')
const dock = require('./utils/dock')
const { analyticsKeys } = require('./analytics/keys')
const getCtx = require('./context')

module.exports = function ({ stopIpfs, startIpfs }) {
module.exports = function () {
dock.run(async () => {
logger.info('[move repository] user prompted about effects')
const ctx = getCtx()
const stopIpfs = ctx.getFn('stopIpfs')
const startIpfs = ctx.getFn('startIpfs')

const opt = showDialog({
title: i18n.t('moveRepositoryWarnDialog.title'),
Expand Down
3 changes: 3 additions & 0 deletions src/run-gc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ const logger = require('./common/logger')
const { showDialog, recoverableErrorDialog } = require('./dialogs')
const dock = require('./utils/dock')
const ipcMainEvents = require('./common/ipc-main-events')
const getCtx = require('./context')

module.exports = function runGarbageCollector ({ getIpfsd }) {
dock.run(async () => {
logger.info('[run gc] alerting user for effects')
const ctx = getCtx()
const getIpfsd = ctx.getFn('getIpfsd')

const opt = showDialog({
title: i18n.t('runGarbageCollectorWarning.title'),
Expand Down
4 changes: 2 additions & 2 deletions src/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ async function buildMenu () {
id: 'runGarbageCollector',
label: i18n.t('runGarbageCollector'),
// @ts-ignore
click: () => { runGarbageCollector(ctx) },
click: () => { runGarbageCollector() },
enabled: false
},
{ type: 'separator' },
{
id: 'moveRepositoryLocation',
label: i18n.t('moveRepositoryLocation'),
// @ts-ignore
click: () => { moveRepositoryLocation(ctx) }
click: () => { moveRepositoryLocation() }
},
{
id: 'setCustomBinary',
Expand Down

0 comments on commit c11104a

Please sign in to comment.