mobile spotlight

This commit is contained in:
Peter Papp
2021-08-10 10:19:10 +02:00
parent 79295e77b6
commit 1175724e43
17 changed files with 241 additions and 824 deletions
-38
View File
@@ -8,7 +8,6 @@ const defaultState = {
currentFolder: undefined,
navigation: undefined,
isSearching: false,
isLoading: true,
browseHistory: [],
@@ -23,12 +22,6 @@ const actions = {
if (payload.init)
commit('FLUSH_FOLDER_HISTORY')
// Clear search
if (getters.isSearching) {
commit('CHANGE_SEARCHING_STATE', false)
events.$emit('clear-query')
}
// Set folder location
payload.folder.location = payload.folder.deleted_at || payload.folder.location === 'trash' ? 'trash' : 'base'
@@ -130,33 +123,6 @@ const actions = {
})
.catch(() => Vue.prototype.$isSomethingWrong())
},
getSearchResult: ({commit, getters}, query) => {
commit('LOADING_STATE', {loading: true, data: []})
commit('CHANGE_SEARCHING_STATE', true)
// Get route
let route = undefined
if (getters.sharedDetail) {
let permission = getters.sharedDetail.is_protected
? 'private'
: 'public'
route = `/api/browse/search/${permission}/${router.currentRoute.params.token}`
} else {
route = '/api/browse/search'
}
axios
.get(route, {
params: {query: query}
})
.then(response => {
commit('LOADING_STATE', {loading: false, data: response.data})
})
.catch(() => Vue.prototype.$isSomethingWrong())
},
getFolderTree: ({commit, getters}) => {
return new Promise((resolve, reject) => {
@@ -224,9 +190,6 @@ const mutations = {
}
})
},
CHANGE_SEARCHING_STATE(state, searchState) {
state.isSearching = searchState
},
UPDATE_SHARED_ITEM(state, data) {
state.entries.find(item => {
if (item.id === data.item_id) item.shared = data
@@ -274,7 +237,6 @@ const getters = {
clipboard: state => state.clipboard,
currentFolder: state => state.currentFolder,
browseHistory: state => state.browseHistory,
isSearching: state => state.isSearching,
navigation: state => state.navigation,
isLoading: state => state.isLoading,
entries: state => state.entries,