Skip to content

Commit acaee3c

Browse files
authored
Merge pull request #641 from AOEpeople/feature/271660_keep-alive
Add keep alive keycloak session
2 parents d944d66 + 1f2b158 commit acaee3c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Resources/src/components/balance/TransactionPanel.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ onMounted(async () => {
6060
});
6161
6262
if (paypal && paypal.Buttons) {
63+
let activeSessionIntervalId: NodeJS.Timeout | number;
6364
paypal
6465
.Buttons({
6566
onInit: function (_data, actions) {
@@ -82,7 +83,12 @@ onMounted(async () => {
8283
);
8384
},
8485
createOrder: function (_data, actions) {
85-
checkActiveSession();
86+
activeSessionIntervalId = setInterval(
87+
() => {
88+
checkActiveSession();
89+
},
90+
10 * 60 * 1000
91+
);
8692
return actions.order.create({
8793
purchase_units: [
8894
{
@@ -99,6 +105,7 @@ onMounted(async () => {
99105
return actions.resolve();
100106
},
101107
onApprove: async function (data, actions) {
108+
clearInterval(activeSessionIntervalId);
102109
isLoading.value = true;
103110
try {
104111
await actions.order?.capture();

0 commit comments

Comments
 (0)