cleaning up
This commit is contained in:
parent
9a13c58583
commit
3431eaf309
2 changed files with 0 additions and 25 deletions
|
|
@ -14,7 +14,6 @@ import { StrudelMirror, defaultSettings } from '@strudel/codemirror';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { settingsMap, useSettings } from '../settings.mjs';
|
import { settingsMap, useSettings } from '../settings.mjs';
|
||||||
import {
|
import {
|
||||||
initUserCode,
|
|
||||||
setActivePattern,
|
setActivePattern,
|
||||||
setLatestCode,
|
setLatestCode,
|
||||||
createPatternID,
|
createPatternID,
|
||||||
|
|
@ -103,7 +102,6 @@ export function Repl({ embedded = false }) {
|
||||||
let msg;
|
let msg;
|
||||||
if (decoded) {
|
if (decoded) {
|
||||||
editor.setCode(decoded);
|
editor.setCode(decoded);
|
||||||
initUserCode(decoded);
|
|
||||||
msg = `I have loaded the code from the URL.`;
|
msg = `I have loaded the code from the URL.`;
|
||||||
} else if (latestCode) {
|
} else if (latestCode) {
|
||||||
editor.setCode(latestCode);
|
editor.setCode(latestCode);
|
||||||
|
|
@ -113,7 +111,6 @@ export function Repl({ embedded = false }) {
|
||||||
msg = `A random code snippet named "${name}" has been loaded!`;
|
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');
|
logger(`Welcome to Strudel! ${msg} Press play or hit ctrl+enter to run it!`, 'highlight');
|
||||||
// setPending(false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
editorRef.current = editor;
|
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
|
// reason: https://github.com/tidalcycles/strudel/issues/857
|
||||||
const $activePattern = persistentAtom('activePattern', '', { listen: false });
|
const $activePattern = persistentAtom('activePattern', '', { listen: false });
|
||||||
|
|
||||||
|
|
@ -88,15 +75,6 @@ export function getActivePattern() {
|
||||||
export function useActivePattern() {
|
export function useActivePattern() {
|
||||||
return useStore($activePattern);
|
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);
|
export const setLatestCode = (code) => settingsMap.setKey('latestCode', code);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue