improve code init logic
This commit is contained in:
parent
faaed61384
commit
853a31b638
2 changed files with 7 additions and 6 deletions
|
|
@ -36,6 +36,11 @@ export function getActivePattern() {
|
|||
export function useActivePattern() {
|
||||
return useStore($activePattern);
|
||||
}
|
||||
export function initUserCode(code) {
|
||||
const userPatterns = getUserPatterns();
|
||||
const match = Object.entries(userPatterns).find(([_, pat]) => pat.code === code);
|
||||
setActivePattern(match?.[0] || '');
|
||||
}
|
||||
|
||||
export function useSettings() {
|
||||
const state = useStore(settingsMap);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue