Skip to content

Commit

Permalink
🐛 fix: 显示 emoji 的顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
frostime committed Oct 7, 2024
1 parent 46097c6 commit 335be6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/components/select-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const SelectIcons = (props: IProps) => {

const i18n = inject<I18n>('i18n');

const ALLOWED_EMOJI_GROUP = ['object', 'symbols', 'flags', 'nature', 'people', 'activity', 'travel'];
const EmojisGroups = (window.siyuan.emojis as ImojiGroup[]).filter(emoji => ALLOWED_EMOJI_GROUP.includes(emoji.id))
.sort((a, b) => ALLOWED_EMOJI_GROUP.indexOf(a.id) - ALLOWED_EMOJI_GROUP.indexOf(b.id));
const ALLOWED_EMOJI_GROUP = ['activity', 'travel', 'people', 'nature', 'food', 'symbols', 'object', 'flags'];
let EmojisGroups = (window.siyuan.emojis as ImojiGroup[]).filter(emoji => ALLOWED_EMOJI_GROUP.includes(emoji.id));
EmojisGroups.sort((a, b) => ALLOWED_EMOJI_GROUP.indexOf(a.id) - ALLOWED_EMOJI_GROUP.indexOf(b.id))
const emojiUnicodes = EmojisGroups.map(group => group.items.map(item => item.unicode)).flat();

const SIZE = '20px'
const SIZE = '20px';

const AllSymbols = () => (
<div class="icons">
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import vitePluginYamlI18n from './yaml-plugin';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const isSrcmap = env.VITE_SOURCEMAP === 'inline';
const isDev = mode === 'development';
const isDev = env.NODE_ENV === 'development';
const distDir = isDev ? "dev" : "dist";

console.log("isDev=>", isDev);
console.log("isSrcmap=>", isSrcmap);
console.log("distDir=>", distDir);

return {
resolve: {
Expand Down

0 comments on commit 335be6b

Please sign in to comment.