mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-04 16:58:05 +02:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4e02a1cd1 |
@@ -782,7 +782,8 @@ function Placeholder(props) {
|
||||
//enable dragging functionality only if isAlllowModify true on tab that widget and hold 1sec
|
||||
if (
|
||||
props.isAlllowModify &&
|
||||
props?.assignedWidgetId.includes(props.pos.key)
|
||||
props?.assignedWidgetId.includes(props.pos.key) &&
|
||||
props.data?.signerObjId === props.signerObjId
|
||||
) {
|
||||
//if 'isTouchDevice' then handle dragging functionality conditionaly
|
||||
if (isTouchDevice) {
|
||||
@@ -794,7 +795,8 @@ function Placeholder(props) {
|
||||
} else if (
|
||||
//condition when 'isAlllowModify' is true and user add new widgets then handle dragging functionality like signyourself flow
|
||||
props.isAlllowModify &&
|
||||
!props?.assignedWidgetId.includes(props.pos.key)
|
||||
!props?.assignedWidgetId.includes(props.pos.key) &&
|
||||
props.data?.signerObjId === props.signerObjId
|
||||
) {
|
||||
return !isDraggingEnabled;
|
||||
} else {
|
||||
|
||||
@@ -105,20 +105,29 @@ export const updateMailCount = async (extUserId, plan, monthchange) => {
|
||||
try {
|
||||
const contractUser = await query.first({ useMasterKey: true });
|
||||
if (contractUser) {
|
||||
const _extRes = JSON.parse(JSON.stringify(contractUser));
|
||||
let updateDate = new Date();
|
||||
if (_extRes?.LastEmailCountReset?.iso) {
|
||||
updateDate = new Date(_extRes?.LastEmailCountReset?.iso);
|
||||
const newDate = new Date();
|
||||
// Update the month while keeping the same day and year
|
||||
updateDate.setMonth(newDate.getMonth());
|
||||
updateDate.setFullYear(newDate.getFullYear());
|
||||
}
|
||||
contractUser.increment('EmailCount', 1);
|
||||
if (plan === 'freeplan') {
|
||||
if (monthchange) {
|
||||
contractUser.set('LastEmailCountReset', new Date());
|
||||
contractUser.set('LastEmailCountReset', updateDate);
|
||||
contractUser.set('MonthlyFreeEmails', 1);
|
||||
} else {
|
||||
if (contractUser?.get('MonthlyFreeEmails')) {
|
||||
contractUser.increment('MonthlyFreeEmails', 1);
|
||||
if (contractUser?.get('LastEmailCountReset')) {
|
||||
contractUser.set('LastEmailCountReset', new Date());
|
||||
contractUser.set('LastEmailCountReset', updateDate);
|
||||
}
|
||||
} else {
|
||||
contractUser.set('MonthlyFreeEmails', 1);
|
||||
contractUser.set('LastEmailCountReset', new Date());
|
||||
contractUser.set('LastEmailCountReset', updateDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user