Skip to content

Commit 1c5f0e6

Browse files
authored
Merge pull request #114 from unfoldingWord/bug-cn-relocate-saveCache
relocate saveCache function
2 parents 63828e1 + 66be7c2 commit 1c5f0e6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/file/useFile.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ function useFile({
179179
update();
180180
}, [update, blobActions, onFilepath]);
181181

182+
const saveCache = useCallback(async (content) => {
183+
if (onSaveCache) {
184+
await onSaveCache({authentication, repository, branch, file, content});
185+
}
186+
}, [writeable, authentication, repository, branch, file, onSaveCache]);
187+
182188
const save = useCallback(async (content) => {
183189
console.log("GRT save // will save file");
184190
await saveFile({
@@ -196,12 +202,6 @@ function useFile({
196202
);
197203
}, [writeable, authentication, repository, branch, file, load, saveFile, saveCache]);
198204

199-
const saveCache = useCallback(async (content) => {
200-
if (onSaveCache) {
201-
await onSaveCache({authentication, repository, branch, file, content});
202-
}
203-
}, [writeable, authentication, repository, branch, file, onSaveCache]);
204-
205205
const dangerouslyDelete = useCallback(async () => {
206206
if (writeable) {
207207
const _deleted = await deleteFile({

0 commit comments

Comments
 (0)