mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
20 lines
594 B
TypeScript
20 lines
594 B
TypeScript
import { BrowserWindow, ipcMain } from 'electron';
|
|
import prompt from 'custom-electron-prompt';
|
|
|
|
import promptOptions from '../../providers/prompt-options';
|
|
|
|
export default (win: BrowserWindow) => {
|
|
ipcMain.handle('captionsSelector', async (_, captionLabels: Record<string, string>, currentIndex: string) => await prompt(
|
|
{
|
|
title: 'Choose Caption',
|
|
label: `Current Caption: ${captionLabels[currentIndex] || 'None'}`,
|
|
type: 'select',
|
|
value: currentIndex,
|
|
selectOptions: captionLabels,
|
|
resizable: true,
|
|
...promptOptions(),
|
|
},
|
|
win,
|
|
));
|
|
};
|