mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-19 19:24:03 +00:00
Refactor Administration entrypoint
We moved the administration item to the company switcher in the header
This commit is contained in:
14
resources/scripts/admin/stores/company.js
vendored
14
resources/scripts/admin/stores/company.js
vendored
@@ -14,18 +14,32 @@ export const useCompanyStore = (useWindow = false) => {
|
||||
selectedCompany: null,
|
||||
selectedCompanySettings: {},
|
||||
selectedCompanyCurrency: null,
|
||||
isAdminMode: window.Ls?.get('isAdminMode') === 'true',
|
||||
}),
|
||||
|
||||
actions: {
|
||||
setSelectedCompany(data) {
|
||||
if (data) {
|
||||
window.Ls.set('selectedCompany', data.id)
|
||||
window.Ls.remove('isAdminMode')
|
||||
this.isAdminMode = false
|
||||
} else {
|
||||
window.Ls.remove('selectedCompany')
|
||||
}
|
||||
this.selectedCompany = data
|
||||
},
|
||||
|
||||
setAdminMode(enabled) {
|
||||
this.isAdminMode = enabled
|
||||
if (enabled) {
|
||||
window.Ls.set('isAdminMode', 'true')
|
||||
window.Ls.remove('selectedCompany')
|
||||
this.selectedCompany = null
|
||||
} else {
|
||||
window.Ls.remove('isAdminMode')
|
||||
}
|
||||
},
|
||||
|
||||
fetchBasicMailConfig() {
|
||||
return new Promise((resolve, reject) => {
|
||||
http
|
||||
|
||||
Reference in New Issue
Block a user