Skip to content

Commit

Permalink
add create download queue types
Browse files Browse the repository at this point in the history
  • Loading branch information
bgawkuc committed Jun 6, 2024
1 parent 729aaa1 commit fbaa95f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions desktop/createDownloadQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,4 @@ const createDownloadQueue = () => {
};

export default createDownloadQueue;
export type {DownloadItem};
10 changes: 8 additions & 2 deletions desktop/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import type PlatformSpecificUpdater from '@src/setup/platformSetup/types';
import type {Locale} from '@src/types/onyx';
import type {DownloadItem} from './createDownloadQueue';
import ELECTRON_EVENTS from './ELECTRON_EVENTS';

const createDownloadQueue = require('./createDownloadQueue').default;
type CreateDownloadQueue = () => {
enqueueDownloadItem: (item: DownloadItem) => void;
dequeueDownloadItem: () => DownloadItem | undefined;
};

const createDownloadQueue: CreateDownloadQueue = require('./createDownloadQueue').default;

const port = process.env.PORT ?? 8082;
const {DESKTOP_SHORTCUT_ACCELERATOR, LOCALES} = CONST;
Expand Down Expand Up @@ -617,7 +623,7 @@ const mainWindow = (): Promise<void> => {

const downloadQueue = createDownloadQueue();
ipcMain.on(ELECTRON_EVENTS.DOWNLOAD, (event, downloadData) => {
const downloadItem = {
const downloadItem: DownloadItem = {
...downloadData,
win: browserWindow,
};
Expand Down

0 comments on commit fbaa95f

Please sign in to comment.