mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 11:21:46 +00:00
QOL: Move source code under the src directory. (#1318)
This commit is contained in:
19
src/plugins/captions-selector/back.ts
Normal file
19
src/plugins/captions-selector/back.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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,
|
||||
));
|
||||
};
|
||||
Reference in New Issue
Block a user