feat(v1.3.0): 图片编辑器(裁剪/旋转/图像大小/调色) + 批量水印 + AI生图 + 收藏体系 + 图片新窗口打开按钮 + 合拼拼图 + 返回顶部
This commit is contained in:
1 parent
e345456abf
commit
94ac94436c
46 files changed
+6521
-114
No files matched your search
@@ -15,7 +15,7 @@ const logger = createLogger('MainContent');
|
||||
|
||||
function MainContent() {
|
||||
const { currentLibraryId } = useLibraryStore();
|
||||
const { searchKeywords, filters, selectedFolder, setImages, setOriginalImages, imageLoadingState, images } = useImageStore();
|
||||
const { searchKeywords, filters, selectedFolder, favoritesView, setImages, setOriginalImages, imageLoadingState, images, refreshTick } = useImageStore();
|
||||
const { scanProgress } = useScanStore();
|
||||
|
||||
// 使用 ref 跟踪最新的请求上下文
|
||||
@@ -47,8 +47,8 @@ function MainContent() {
|
||||
const loadImages = useCallback(async (isInitialLoad = true) => {
|
||||
if (!currentLibraryId) return;
|
||||
|
||||
// 如果没有选中文件夹且没有搜索条件,显示 Dashboard
|
||||
if (!selectedFolder && !searchKeywords && filters.formats.length === 0) {
|
||||
// 如果没有选中文件夹且没有搜索条件,显示 Dashboard(「我的收藏」视图除外)
|
||||
if (!selectedFolder && !searchKeywords && filters.formats.length === 0 && !favoritesView) {
|
||||
setImages([]);
|
||||
useImageStore.getState().setImageLoadingState({
|
||||
isLoading: false,
|
||||
@@ -80,6 +80,7 @@ function MainContent() {
|
||||
limit: 100
|
||||
};
|
||||
if (selectedFolder) params.folder = selectedFolder;
|
||||
if (favoritesView) params.favorite = 1;
|
||||
if (searchKeywords) params.keywords = searchKeywords;
|
||||
if (filters.formats?.length > 0) params.formats = filters.formats.join(',');
|
||||
|
||||
@@ -128,7 +129,7 @@ function MainContent() {
|
||||
currentRequestContextRef.current = null;
|
||||
}
|
||||
}
|
||||
}, [currentLibraryId, searchKeywords, selectedFolder, setImages, setOriginalImages, cancelCurrentRequest]);
|
||||
}, [currentLibraryId, searchKeywords, selectedFolder, favoritesView, setImages, setOriginalImages, cancelCurrentRequest]);
|
||||
|
||||
// 监听文件夹/搜索变化
|
||||
useEffect(() => {
|
||||
@@ -161,7 +162,7 @@ function MainContent() {
|
||||
clearTimeout(debounceTimerRef.current);
|
||||
}
|
||||
};
|
||||
}, [currentLibraryId, searchKeywords, selectedFolder, loadImages, cancelCurrentRequest]);
|
||||
}, [currentLibraryId, searchKeywords, selectedFolder, favoritesView, refreshTick, loadImages, cancelCurrentRequest]);
|
||||
|
||||
// 恢复撤销前的文件夹状态
|
||||
useEffect(() => {
|
||||
@@ -232,7 +233,7 @@ function MainContent() {
|
||||
|
||||
{/* Content */}
|
||||
<div className="flex-1 overflow-hidden">
|
||||
{(!selectedFolder && !searchKeywords && filters.formats.length === 0) ? (
|
||||
{(!selectedFolder && !searchKeywords && filters.formats.length === 0 && !favoritesView) ? (
|
||||
<Dashboard />
|
||||
) : (
|
||||
<ImageWaterfall />
|
||||
|
||||
Reference in new issue
Block a user