mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
22 lines
545 B
JavaScript
22 lines
545 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) => {
|
|
return await prompt(
|
|
{
|
|
title: "Choose Caption",
|
|
label: `Current Caption: ${captionLabels[currentIndex] || "None"}`,
|
|
type: "select",
|
|
value: currentIndex,
|
|
selectOptions: captionLabels,
|
|
resizable: true,
|
|
...promptOptions(),
|
|
},
|
|
win
|
|
);
|
|
});
|
|
};
|