Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V8.0.0 #624

Merged
merged 61 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0310fa4
fix: 修复钱包索引问题
1zilc Jun 27, 2023
6730a41
feat: 迁移至electron-vite (#623)
1zilc Jun 29, 2023
9e13cbd
fix: 适配spin变动
1zilc Jun 29, 2023
ea809af
chore: 修改默认导出
1zilc Jun 29, 2023
4eb41e6
fix: 修复导出热更新问题
1zilc Jun 30, 2023
fe6df88
fix: 支持HMR
1zilc Jun 30, 2023
84504d9
fix: 路由
1zilc Jun 30, 2023
904db4a
fix: unikey
1zilc Jun 30, 2023
5cd8a33
feat: echarts按需
1zilc Jun 30, 2023
74b3376
feat: 优化打包
1zilc Jun 30, 2023
0268990
fix: 移除冗余逻辑
1zilc Jun 30, 2023
ec050ec
feat: 完成股票】、指数涨跌提醒
1zilc Jul 1, 2023
1953669
fix: 优化Row重复渲染问题
1zilc Jul 1, 2023
9f89b64
fix: 移除tsx loader
1zilc Jul 1, 2023
67e3150
feat: 优化同类基金获取
1zilc Jul 2, 2023
bae4f8d
fix: 补充echarts中文包
1zilc Jul 2, 2023
d2e4827
fix: decodeFF类型错误
1zilc Jul 3, 2023
74b7430
feat: 优化股票store
1zilc Jul 3, 2023
a54fca9
feat: 优化coin store
1zilc Jul 3, 2023
24323ef
feat: 优化quotation store
1zilc Jul 3, 2023
43b2ea9
feat: 优化wallet store
1zilc Jul 3, 2023
f42eb54
feat: 优化fund store
1zilc Jul 3, 2023
51f60f8
feat: 优化web store
1zilc Jul 3, 2023
6cae6be
feat: 优化zindex store
1zilc Jul 3, 2023
d870eaf
feat: 添加股票收益计算
1zilc Jul 3, 2023
8ace15d
fix: 优化钱包显示
1zilc Jul 4, 2023
b111795
fix: 优化钱包显示
1zilc Jul 4, 2023
af076d4
fix: 移除不必要的依赖
1zilc Jul 4, 2023
574817b
feat: 添加股票更多排序
1zilc Jul 4, 2023
bc3bbc9
fix: 股票新增
1zilc Jul 4, 2023
47737d3
feat: 股票管理编辑图标
1zilc Jul 4, 2023
53f5094
feat: 右键菜单支持股票收益显示
1zilc Jul 4, 2023
e5f22e7
feat: 托盘添加股票收益
1zilc Jul 4, 2023
6beef69
feat: 优化刷新逻辑
1zilc Jul 6, 2023
65e686a
feat: 股票添加持有分组、移除债券分组
1zilc Jul 6, 2023
b37e216
fix: tabs destroyInactiveTabPane
1zilc Jul 6, 2023
ff1c6a8
fix: 钱包图标内联
1zilc Jul 6, 2023
4d041a7
Bump compare-versions from 5.0.3 to 6.0.0 (#627)
dependabot[bot] Jul 10, 2023
4dae5bd
feat: 优化基金tag
1zilc Jul 13, 2023
47e21d0
feat: 基金详情添加经理头像
1zilc Jul 13, 2023
040c2ae
Merge branch 'dev' of github.com:1zilc/fishing-funds into dev
1zilc Jul 13, 2023
50ccda2
feat: 支持设置低调程度
1zilc Jul 14, 2023
a7914d6
chore: 修改部分组件
1zilc Jul 17, 2023
117e501
feat: 添加去重复
1zilc Jul 18, 2023
709b1b9
feat: 股票支持钱包分组、钱包支持股票收益
1zilc Jul 19, 2023
baad2db
fix: 完成股票配置迁移
1zilc Jul 19, 2023
6bd8b6d
fix: 修复股票自动刷新
1zilc Jul 19, 2023
428978d
fix: 移除冗余逻辑
1zilc Jul 19, 2023
5679f48
feat: 完成钱包样式优化
1zilc Jul 19, 2023
9237dd5
fix: 修改隐私模式
1zilc Jul 19, 2023
088cda7
feat: 样式优化
1zilc Jul 19, 2023
7c660a3
Bump clsx from 1.2.1 to 2.0.0 (#630)
dependabot[bot] Jul 19, 2023
2323c4e
Bump @types/node from 20.2.5 to 20.4.2 (#629)
dependabot[bot] Jul 19, 2023
6f3055a
feat: 添加收益详情
1zilc Jul 19, 2023
9f55eab
Merge branch 'dev' of github.com:1zilc/fishing-funds into dev
1zilc Jul 19, 2023
58deb6a
bump: 升级依赖
1zilc Jul 19, 2023
44bb1ad
fix: 修复刷新问题
1zilc Jul 19, 2023
04a7b39
fix: 修复部分样式错误
1zilc Jul 20, 2023
797478a
fix: 修复数据错误
1zilc Jul 20, 2023
1f1c89d
fix: 修复显示错误
1zilc Jul 20, 2023
94addc8
fix: 修复显示nan
1zilc Jul 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: 修复股票自动刷新
  • Loading branch information
1zilc committed Jul 19, 2023
commit 6bd8b6dda37b2c6a9e968c0d45b48589088c4602
1 change: 0 additions & 1 deletion src/renderer/typings/helper.d.ts

This file was deleted.

14 changes: 7 additions & 7 deletions src/renderer/utils/hooks/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
useLoadRemoteFunds,
useLoadFundRatingMap,
useLoadWalletsFunds,
useLoadWalletsStocks,
useLoadFixWalletsFunds,
useLoadQuotations,
useLoadZindexs,
Expand Down Expand Up @@ -320,6 +321,7 @@ export function useBootStrap() {
const runLoadRemoteCoins = useLoadRemoteCoins();
const runLoadWalletsFunds = useLoadWalletsFunds();
const runLoadFixWalletsFunds = useLoadFixWalletsFunds();
const runLoadWalletsStocks = useLoadWalletsStocks();
const runLoadZindexs = useLoadZindexs({
enableLoading: false,
autoFilter: false,
Expand All @@ -328,10 +330,6 @@ export function useBootStrap() {
enableLoading: false,
autoFilter: false,
});
const runLoadStocks = useLoadStocks({
enableLoading: false,
autoFilter: false,
});
const runLoadCoins = useLoadCoins({
enableLoading: false,
autoFilter: false,
Expand All @@ -349,7 +347,8 @@ export function useBootStrap() {
if (autoFreshSetting) {
Adapters.ConCurrencyAllAdapter([
() => Adapters.ChokeAllAdapter([runLoadWalletsFunds]),
() => Adapters.ChokeAllAdapter([runLoadZindexs, runLoadQuotations, runLoadStocks]),
() => Adapters.ChokeAllAdapter([runLoadWalletsStocks]),
() => Adapters.ChokeAllAdapter([runLoadZindexs, runLoadQuotations]),
]);
}
}, freshDelaySetting * 1000 * 60);
Expand All @@ -359,7 +358,7 @@ export function useBootStrap() {
if (autoFreshSetting) {
Adapters.ChokeAllAdapter([runLoadFixWalletsFunds]);
}
}, 1000 * 60 * 5);
}, 1000 * 60 * 10);

// 间隔时间刷新货币
useInterval(() => {
Expand All @@ -373,7 +372,8 @@ export function useBootStrap() {
Adapters.ConCurrencyAllAdapter([
() => Adapters.ChokeAllAdapter([runLoadRemoteFunds, runLoadRemoteCoins, runLoadFundRatingMap]),
() => Adapters.ChokeAllAdapter([runLoadWalletsFunds, runLoadFixWalletsFunds]),
() => Adapters.ChokeAllAdapter([runLoadZindexs, runLoadQuotations, runLoadStocks, runLoadCoins]),
() => Adapters.ChokeAllAdapter([runLoadWalletsStocks]),
() => Adapters.ChokeAllAdapter([runLoadZindexs, runLoadQuotations, runLoadCoins]),
]);
}, []);
}
Expand Down
32 changes: 31 additions & 1 deletion src/renderer/utils/hooks/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export function useLoadWalletsFunds() {

const load = useMemoizedFn(async () => {
// 优化多钱包同一支基金重复获取
const responseMap = {} as Record<string, PromiseInnerType<ReturnType<typeof Helpers.Fund.GetFunds>>[number]>;
const responseMap = {} as Record<string, Awaited<ReturnType<typeof Helpers.Fund.GetFunds>>[number]>;
try {
const collects = walletConfig.map(({ funds: fundsConfig, code: walletCode }) => async () => {
const unRequestConfig = fundsConfig.filter(({ code }) => !responseMap[code]); // 未请求过的配置
Expand Down Expand Up @@ -500,6 +500,36 @@ export function useLoadStocks(config?: {
return fn;
}

export function useLoadWalletsStocks() {
const dispatch = useAppDispatch();
const { walletConfig } = useAppSelector((state) => state.wallet.config);

const load = useMemoizedFn(async () => {
const responseMap = {} as Record<string, Awaited<ReturnType<typeof Helpers.Stock.GetStocks>>[number]>;
try {
const collects = walletConfig.map(({ stocks: stocksConfig, code: walletCode }) => async () => {
const unRequestConfig = stocksConfig.filter(({ secid }) => !responseMap[secid]); // 未请求过的配置
const responseStocks = await Helpers.Stock.GetStocks(unRequestConfig);
// 将请求的结果保存到map
responseStocks.forEach((response) => {
responseMap[response.secid!] = response;
});
// 用code去取已经获取到的结果
const finalResponseStocks = stocksConfig
.filter(({ secid }) => !!responseMap[secid])
.map(({ secid }) => responseMap[secid]);
const now = dayjs().format('MM-DD HH:mm:ss');
dispatch(updateWalletStateAction({ code: walletCode, stocks: finalResponseStocks, updateTime: now }));
return responseStocks;
});
await Adapters.ChokeAllAdapter(collects, CONST.DEFAULT.LOAD_WALLET_DELAY);
} catch (error) {}
});

const fn = useTabsFreshFn(Enums.TabKeyType.Fund, load);
return fn;
}

export function useFreshCoins() {
const loadCoins = useLoadCoins({
enableLoading: true,
Expand Down