Skip to content

Commit

Permalink
fix(ios): unhide logseq folder in iCloud Drive
Browse files Browse the repository at this point in the history
Simplily adding an empty .logseq file at the container root to reveal
the logseq folder
  • Loading branch information
leizhe authored and tiensonqin committed Dec 25, 2021
1 parent aaceac2 commit 2c1b32e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ios/App/App/FileContainer.swift
Expand Up @@ -32,6 +32,19 @@ public class FileContainer: CAPPlugin, UIDocumentPickerDelegate {
}
}

let str = ""
guard let filename = self.containerUrl?.appendingPathComponent(".logseq") else {
return
}

if !FileManager.default.fileExists(atPath: filename.path) {
do {
try str.write(to: filename, atomically: true, encoding: String.Encoding.utf8)
}
catch {
// failed to write file – bad permissions, bad filename, missing permissions, or more likely it can't be converted to the encoding
}
}
self._call?.resolve([
"path": self.containerUrl?.path
])
Expand Down

0 comments on commit 2c1b32e

Please sign in to comment.