Skip to content

Commit

Permalink
refactor to un block reference of transition token
Browse files Browse the repository at this point in the history
  • Loading branch information
robinhoodie0823 committed Oct 27, 2023
1 parent 9bb5e2c commit 6d05962
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/components/Tokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function Tokens({ isActive }: { isActive: boolean }) {
})),
[tokens, usedTokenSet, activeTokenSet],
);

const tokenType = useSelector(tokenTypeSelector);

const [error, setError] = React.useState<string | null>(null);
Expand Down Expand Up @@ -164,7 +165,6 @@ function Tokens({ isActive }: { isActive: boolean }) {
}, [dispatch.uiState]);

const handleSetTokensTabToJSON = React.useCallback(() => {
console.log('show tokens in json');
dispatch.uiState.setActiveTokensTab('json');
}, [dispatch.uiState]);

Expand Down
5 changes: 3 additions & 2 deletions src/utils/TokenResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class TokenResolver {
this.tokenMap = new Map();
this.memo = new Map();
this.populateTokenMap();

return this.resolveTokenValues();
}

Expand Down Expand Up @@ -187,10 +188,10 @@ class TokenResolver {
}
} else {
// If it's not, we mark it as failed to resolve
const hasFailingReferences = !AliasRegex.test(JSON.stringify(finalValue));
// const hasFailingReferences = !AliasRegex.test(JSON.stringify(finalValue));

resolvedToken = {
...token, value: finalValue, rawValue: token.value, ...(hasFailingReferences ? { failedToResolve: true } : {}),
...token, value: finalValue, rawValue: token.value, ...{},
} as ResolveTokenValuesResult;
}

Expand Down
1 change: 1 addition & 0 deletions src/utils/tokenHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ export function mergeTokenGroups(tokens: Record<string, SingleToken[]>, usedSets
});
}
});

return mergedTokens;
}

0 comments on commit 6d05962

Please sign in to comment.