Skip to content

Commit 0da9c70

Browse files
committed
Merge branch 'develop'
2 parents 74331e1 + 244ffc3 commit 0da9c70

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v2.0.5
2+
- FIX: Display sync folder path
3+
14
## v2.0.4
25
- FIX: getAllAccounts didn't have a fallback for the initial loading of the extension
36

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 2,
33
"name": "Floccus (nextcloud Sync)",
44
"short_name": "Floccus",
5-
"version": "2.0.4",
5+
"version": "2.0.5",
66
"description": "Sync your browser with nextcloud (currently only bookmarks; more to come)",
77
"icons": {
88
"48": "icons/logo.png"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "floccus",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"description": "The goal of this project is to build a browser extension that syncs your browser data with [OwnCloud](http://owncloud.org).",
55
"main": "index.js",
66
"scripts": {

src/lib/Tree.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,27 @@ export default class Tree {
163163
return recurse(tree)
164164
}
165165

166+
static async getPathFromLocalId (localId, ancestors, relativeToRoot) {
167+
ancestors = ancestors || await Tree.getIdPathFromLocalId(localId)
168+
169+
if (relativeToRoot) {
170+
ancestors = ancestors.slice(ancestors.indexOf(relativeToRoot) + 1)
171+
}
172+
173+
return '/' + (await Promise.all(
174+
ancestors
175+
.map(async ancestor => {
176+
try {
177+
let bms = await browser.bookmarks.getSubTree(ancestor)
178+
let bm = bms[0]
179+
return bm.title.replace(/[/]/g, '\\/')
180+
} catch (e) {
181+
return 'Error!'
182+
}
183+
})
184+
)).join('/')
185+
}
186+
166187
async mkdirpPath (path) {
167188
const allAccounts = await Account.getAllAccounts()
168189
return Tree.mkdirpPath(path, this.rootId, allAccounts)

0 commit comments

Comments
 (0)