11/* eslint-disable @typescript-eslint/consistent-type-assertions */
22/* eslint-disable @typescript-eslint/strict-boolean-expressions */
3- import AsyncStorage from '@react-native-async-storage/async-storage' ;
43import { cloneDeep , uniqBy } from 'lodash' ;
54import { create } from 'zustand' ;
6- import { createJSONStorage , devtools , persist } from 'zustand/middleware' ;
5+ import { devtools , persist } from 'zustand/middleware' ;
76import { immer } from 'zustand/middleware/immer' ;
87import { defaultTextBasedTiddlerFilter } from '../constants/filters' ;
98import { WIKI_FOLDER_PATH } from '../constants/paths' ;
9+ import { expoFileSystemStorage } from '../utils/expoFileSystemStorage' ;
1010
1111export interface IWikiWorkspace {
12+ /**
13+ * Allow reading file attachments in the workspace.
14+ */
15+ allowReadFileAttachment ?: boolean ;
1216 /**
1317 * Enable quick load button on workspace list.
1418 * When click on button, will only load recent tiddlers, speed up loading time for huge wiki.
@@ -32,10 +36,6 @@ export interface IWikiWorkspace {
3236 * folder path for this wiki workspace
3337 */
3438 wikiFolderLocation : string ;
35- /**
36- * Allow reading file attachments in the workspace.
37- */
38- allowReadFileAttachment ?: boolean ;
3939}
4040export interface IPageWorkspace {
4141 id : string ;
@@ -184,7 +184,7 @@ export const useWorkspaceStore = create<WikiState & WikiActions>()(
184184 } ) ,
185185 {
186186 name : 'wiki-storage' ,
187- storage : createJSONStorage ( ( ) => AsyncStorage ) ,
187+ storage : expoFileSystemStorage ,
188188 } ,
189189 ) ,
190190 ) ) ,
0 commit comments