mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
fix: company name update in db selector on change
This commit is contained in:
parent
6fdabcb68c
commit
2d7cf505e5
@ -76,14 +76,19 @@ export async function connectToLocalDatabase(filePath) {
|
||||
await postStart();
|
||||
|
||||
// set file info in config
|
||||
const { companyName } = frappe.AccountingSettings;
|
||||
let files = config.get('files') || [];
|
||||
if (!files.find((file) => file.filePath === filePath)) {
|
||||
if (
|
||||
!files.find(
|
||||
(file) => file.filePath === filePath && file.companyName === companyName
|
||||
)
|
||||
) {
|
||||
files = [
|
||||
{
|
||||
companyName: frappe.AccountingSettings.companyName,
|
||||
filePath: filePath,
|
||||
companyName,
|
||||
filePath,
|
||||
},
|
||||
...files,
|
||||
...files.filter((file) => file.filePath !== filePath),
|
||||
];
|
||||
config.set('files', files);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user