@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 8ce4e60
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 4, 09:15 UTC

fix(company): fail closed on stale selected company instead of silently selecting another company

davoodmehraban89 committed Oct 14, 2026 at 11:47 UTC 8ce4e608e75a10d0c974321232b36f22f62bd727
1 file changed +2 -1
js/sync.js
+2 -1
@@ -5,7 +5,8 @@ function getMyCompanies(){return !currentUser?[]:datastore.companies.filter(c=>c
5 function finoraActiveCompanyId(){
6 if(!currentUser)return '';
7 const companies=getMyCompanies(),selected=getMySettings().default_company_id;
8 - return companies.some(c=>c.id===selected)?selected:(companies[0]?.id||'');
8 + if(selected)return companies.some(c=>c.id===selected)?selected:'';
9 + return companies[0]?.id||'';
10 }
11 function finoraInActiveCompany(x,{allowSingleCompanyLegacy=true}={}){
12 if(!currentUser||!x||x.ownerUserId!==currentUser.id)return false;