chore: share view logic responsability
This commit is contained in:
1 parent
d8306559fd
commit
edb9e85efd
12 files changed
+113
-80
No files matched your search
@@ -33,11 +33,11 @@ export async function fetchJSON (url, opts) {
|
||||
}
|
||||
}
|
||||
|
||||
export function removePrefix (url) {
|
||||
export function removePrefix (url, prefix) {
|
||||
if (url.startsWith('/files')) {
|
||||
url = url.slice(6)
|
||||
} else if (store.getters['isSharing']) {
|
||||
url = url.slice(7 + store.state.hash.length)
|
||||
} else if (prefix) {
|
||||
url = url.replace(prefix, '')
|
||||
}
|
||||
|
||||
if (url === '') url = '/'
|
||||
|
||||
Reference in new issue
Block a user