mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-14 15:18:30 +00:00
cleaning up
This commit is contained in:
parent
9a13c58583
commit
3431eaf309
@ -14,7 +14,6 @@ import { StrudelMirror, defaultSettings } from '@strudel/codemirror';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { settingsMap, useSettings } from '../settings.mjs';
|
||||
import {
|
||||
initUserCode,
|
||||
setActivePattern,
|
||||
setLatestCode,
|
||||
createPatternID,
|
||||
@ -103,7 +102,6 @@ export function Repl({ embedded = false }) {
|
||||
let msg;
|
||||
if (decoded) {
|
||||
editor.setCode(decoded);
|
||||
initUserCode(decoded);
|
||||
msg = `I have loaded the code from the URL.`;
|
||||
} else if (latestCode) {
|
||||
editor.setCode(latestCode);
|
||||
@ -113,7 +111,6 @@ export function Repl({ embedded = false }) {
|
||||
msg = `A random code snippet named "${name}" has been loaded!`;
|
||||
}
|
||||
logger(`Welcome to Strudel! ${msg} Press play or hit ctrl+enter to run it!`, 'highlight');
|
||||
// setPending(false);
|
||||
});
|
||||
|
||||
editorRef.current = editor;
|
||||
|
||||
@ -63,19 +63,6 @@ export async function loadDBPatterns() {
|
||||
}
|
||||
}
|
||||
|
||||
//pattern that the use is currently viewing in the window
|
||||
// const $viewingPattern = persistentAtom('viewingPattern', '', { listen: false });
|
||||
// export function setViewingPattern(key) {
|
||||
// $viewingPattern.set(key);
|
||||
// }
|
||||
// export function getViewingPattern() {
|
||||
// return $viewingPattern.get();
|
||||
// }
|
||||
|
||||
// export function useViewingPattern() {
|
||||
// return useStore($viewingPattern);
|
||||
// }
|
||||
// active pattern is separate, because it shouldn't sync state across tabs
|
||||
// reason: https://github.com/tidalcycles/strudel/issues/857
|
||||
const $activePattern = persistentAtom('activePattern', '', { listen: false });
|
||||
|
||||
@ -88,15 +75,6 @@ export function getActivePattern() {
|
||||
export function useActivePattern() {
|
||||
return useStore($activePattern);
|
||||
}
|
||||
export function initUserCode(code) {
|
||||
// const patterns = { ...userPattern.getAll() };
|
||||
// const match = Object.entries(patterns).find(([_, pat]) => pat.code === code);
|
||||
// const id = match?.[0];
|
||||
// if (id != null) {
|
||||
// setActivePattern(id);
|
||||
// setViewingPattern(id);
|
||||
// }
|
||||
}
|
||||
|
||||
export const setLatestCode = (code) => settingsMap.setKey('latestCode', code);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user