large update
This commit is contained in:
1 parent
2ed952f19c
commit
65e85135c1
111 files changed
+3936
-2933
No files matched your search
@@ -29,13 +29,12 @@ export function createBrowserActionService({
|
||||
throw new Error(`Browser action ${actionId} is ${action.status} and cannot be dispatched.`);
|
||||
}
|
||||
if (action.approvalId) {
|
||||
const approval = (() => {
|
||||
try {
|
||||
return db.getApprovalRecord(action.approvalId);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
})();
|
||||
let approval: ReturnType<typeof db.getApprovalRecord> | null = null;
|
||||
try {
|
||||
approval = db.getApprovalRecord(action.approvalId);
|
||||
} catch {
|
||||
// Record not found
|
||||
}
|
||||
if (!approval || approval.companyId !== companyId) {
|
||||
throw new Error(`Browser action approval ${action.approvalId} does not belong to company ${companyId}.`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user