mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 12:38:35 +00:00
update select dialog
This commit is contained in:
parent
e9a0a06b77
commit
cba9169b2f
@ -7,10 +7,9 @@ export function AudioEngineTargetSelector({ target, onChange, isDisabled }) {
|
|||||||
const onTargetChange = (target) => {
|
const onTargetChange = (target) => {
|
||||||
onChange(target);
|
onChange(target);
|
||||||
};
|
};
|
||||||
const options = new Map();
|
const options = new Map([
|
||||||
Array.from(Object.keys(audioEngineTargets)).map((key) => {
|
[audioEngineTargets.webaudio, audioEngineTargets.webaudio ],
|
||||||
options.set(key, key);
|
[audioEngineTargets.superdirt, 'superdirt (osc)'],
|
||||||
});
|
]);
|
||||||
|
|
||||||
return <SelectInput isDisabled={isDisabled} options={options} value={target} onChange={onTargetChange} />;
|
return <SelectInput isDisabled={isDisabled} options={options} value={target} onChange={onTargetChange} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,7 +113,14 @@ export function SettingsTab({ started }) {
|
|||||||
<AudioDeviceSelector
|
<AudioDeviceSelector
|
||||||
isDisabled={started}
|
isDisabled={started}
|
||||||
audioDeviceName={audioDeviceName}
|
audioDeviceName={audioDeviceName}
|
||||||
onChange={(audioDeviceName) => settingsMap.setKey('audioDeviceName', audioDeviceName)}
|
onChange={(audioDeviceName) => {
|
||||||
|
confirmDialog(RELOAD_MSG).then((r) => {
|
||||||
|
if (r == true) {
|
||||||
|
settingsMap.setKey('audioDeviceName', audioDeviceName);
|
||||||
|
return window.location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -97,7 +97,7 @@ export function loadModules() {
|
|||||||
|
|
||||||
return evalScope(settingPatterns, ...modules);
|
return evalScope(settingPatterns, ...modules);
|
||||||
}
|
}
|
||||||
// confirm dialog is a promise in Tauri and possibly other browsers... normalize it to be a promise everywhere
|
// confirm dialog is a promise in webkit and a boolean in other browsers... normalize it to be a promise everywhere
|
||||||
export function confirmDialog(msg) {
|
export function confirmDialog(msg) {
|
||||||
const confirmed = confirm(msg);
|
const confirmed = confirm(msg);
|
||||||
if (confirmed instanceof Promise) {
|
if (confirmed instanceof Promise) {
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { atom } from 'nanostores';
|
import { atom } from 'nanostores';
|
||||||
import { persistentAtom } from '@nanostores/persistent';
|
|
||||||
import { useStore } from '@nanostores/react';
|
import { useStore } from '@nanostores/react';
|
||||||
import { logger } from '@strudel/core';
|
import { logger } from '@strudel/core';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user