Skip to content

Commit

Permalink
Migrated to tanstack-store for state management
Browse files Browse the repository at this point in the history
- Fixed a bug where first metadata line in lrc file is considered a lyric line.
  • Loading branch information
Sandakan committed Sep 17, 2024
1 parent 9f85e6f commit 0519692
Show file tree
Hide file tree
Showing 110 changed files with 1,425 additions and 1,116 deletions.
7 changes: 5 additions & 2 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// import { resolve } from 'path';
/**
* @type {import('electron-vite').UserConfig}
*/
import { resolve } from 'path';
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
import react from '@vitejs/plugin-react';

Expand All @@ -19,7 +22,7 @@ export default defineConfig({
renderer: {
resolve: {
alias: {
// '@renderer': resolve('src/renderer/src')
'@renderer': resolve(import.meta.dirname, './src/renderer/src')
}
},
plugins: [react()]
Expand Down
463 changes: 260 additions & 203 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"@electron-toolkit/utils": "^3.0.0",
"@tanstack/react-query": "^5.52.2",
"@tanstack/react-query-devtools": "^5.52.2",
"@tanstack/react-store": "^0.5.5",
"@tanstack/react-virtual": "^3.10.4",
"@vitalets/google-translate-api": "^9.2.0",
"didyoumean2": "^7.0.2",
Expand Down Expand Up @@ -138,7 +139,7 @@
"eslint-plugin-react-refresh": "^0.4.6",
"husky": "^9.0.11",
"jest": "^29.7.0",
"material-symbols": "^0.22.2",
"material-symbols": "^0.23.0",
"postcss": "^8.4.35",
"prettier": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.6.1",
Expand Down
2 changes: 1 addition & 1 deletion src/@types/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ declare global {
onPageChange?: (changedPageTitle: PageTitles, changedPageData?: any) => void;
}

interface PageData extends Record<string, unknown> {
interface PageData<R = any> extends Record<string, R> {
scrollTopOffset?: number;
isLowResponseRequired?: boolean;
preventScreenSleeping?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/common/parseLyrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const groupOriginalAndTranslatedLyricLines = (lyricsLines: string[], isSynced: b
const groupedLines: { [key: string]: typeof partiallyParsedLines } = {};

partiallyParsedLines.forEach((line) => {
const time = getSecondsFromLyricsLine(line.input).toString();
const time = getSecondsFromLyricsLine(line.input).toFixed(2);

if (!groupedLines[time]) groupedLines[time] = [];
groupedLines[time].push(line);
Expand Down
Loading

0 comments on commit 0519692

Please sign in to comment.