enhance(view):调整地址转换位置。

This commit is contained in:
徐涛
2023-03-08 16:44:18 +08:00
parent 9437e45b8d
commit a77d051b8d
4 changed files with 6 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import { addIndex, map, mergeRight } from 'ramda';
import { convertFileSrc } from '@tauri-apps/api/tauri';
import { addIndex, map, mergeLeft } from 'ramda';
import { FileItem } from '../models';
import { SyncObjectCallback } from '../types';
import { createStoreHook } from '../utils/store_creator';
@@ -23,7 +24,7 @@ export const useFileListStore = createStoreHook<FileListState & FileListActions>
updateFiles(files) {
set(df => {
df.files = addIndex<Omit<FileItem, 'sort'>, FileItem>(map)(
(item, index) => mergeRight({ sort: index * 10 }, item),
(item, index) => mergeLeft({ sort: index * 10, path: convertFileSrc(item.path) }, item),
files
);
});

View File

@@ -17,7 +17,7 @@ type ZoomActions = {
const initialState: ZoomState = {
lock: true,
autoFit: false,
currentZoom: 100,
currentZoom: 80,
viewMode: 'continuation',
viewHeight: 0
};