restored
This commit is contained in:
parent
e0c4997f1e
commit
5ca9afa9e8
10 changed files with 185 additions and 13 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { persistentMap } from '@nanostores/persistent';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { register } from '@strudel/core';
|
||||
import { isUdels } from './repl/util.mjs';
|
||||
|
||||
export const defaultAudioDeviceName = 'System Standard';
|
||||
|
||||
|
|
@ -28,8 +29,12 @@ export const defaultSettings = {
|
|||
userPatterns: '{}',
|
||||
audioDeviceName: defaultAudioDeviceName,
|
||||
};
|
||||
const search = new URLSearchParams(window.location.search);
|
||||
// if running multiple instance in one window, it will use the settings for that instance. else default to normal
|
||||
const instance = parseInt(search.get('instance') ?? '0');
|
||||
const settings_key = `strudel-settings${instance > 0 ? instance : ''}`;
|
||||
|
||||
export const settingsMap = persistentMap('strudel-settings', defaultSettings);
|
||||
export const settingsMap = persistentMap(settings_key, defaultSettings);
|
||||
|
||||
const parseBoolean = (booleanlike) => ([true, 'true'].includes(booleanlike) ? true : false);
|
||||
|
||||
|
|
@ -54,7 +59,7 @@ export function useSettings() {
|
|||
isTooltipEnabled: parseBoolean(state.isTooltipEnabled),
|
||||
isLineWrappingEnabled: parseBoolean(state.isLineWrappingEnabled),
|
||||
isFlashEnabled: parseBoolean(state.isFlashEnabled),
|
||||
isSyncEnabled: parseBoolean(state.isSyncEnabled),
|
||||
isSyncEnabled: isUdels() ? true : parseBoolean(state.isSyncEnabled),
|
||||
fontSize: Number(state.fontSize),
|
||||
panelPosition: state.activeFooter !== '' ? state.panelPosition : 'bottom', // <-- keep this 'bottom' where it is!
|
||||
userPatterns: userPatterns,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue