mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-09 01:31:46 +00:00
20 lines
549 B
JavaScript
20 lines
549 B
JavaScript
const { ipcMain } = require('electron');
|
|
const prompt = require('custom-electron-prompt');
|
|
|
|
const promptOptions = require('../../providers/prompt-options');
|
|
|
|
module.exports = (win) => {
|
|
ipcMain.handle('captionsSelector', async (_, captionLabels, currentIndex) => await prompt(
|
|
{
|
|
title: 'Choose Caption',
|
|
label: `Current Caption: ${captionLabels[currentIndex] || 'None'}`,
|
|
type: 'select',
|
|
value: currentIndex,
|
|
selectOptions: captionLabels,
|
|
resizable: true,
|
|
...promptOptions(),
|
|
},
|
|
win,
|
|
));
|
|
};
|