chore: share view logic responsability

This commit is contained in:
Ramires Viana
2021-03-03 17:46:37 +00:00
parent d8306559fd
commit edb9e85efd
12 changed files with 113 additions and 80 deletions

View File

@@ -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 = '/'