mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 21:58:31 +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) => {
|
||||
onChange(target);
|
||||
};
|
||||
const options = new Map();
|
||||
Array.from(Object.keys(audioEngineTargets)).map((key) => {
|
||||
options.set(key, key);
|
||||
});
|
||||
|
||||
const options = new Map([
|
||||
[audioEngineTargets.webaudio, audioEngineTargets.webaudio ],
|
||||
[audioEngineTargets.superdirt, 'superdirt (osc)'],
|
||||
]);
|
||||
return <SelectInput isDisabled={isDisabled} options={options} value={target} onChange={onTargetChange} />;
|
||||
}
|
||||
|
||||
@ -113,7 +113,14 @@ export function SettingsTab({ started }) {
|
||||
<AudioDeviceSelector
|
||||
isDisabled={started}
|
||||
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>
|
||||
)}
|
||||
|
||||
@ -97,7 +97,7 @@ export function loadModules() {
|
||||
|
||||
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) {
|
||||
const confirmed = confirm(msg);
|
||||
if (confirmed instanceof Promise) {
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { atom } from 'nanostores';
|
||||
import { persistentAtom } from '@nanostores/persistent';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { logger } from '@strudel/core';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user