Plugin Directory

Changeset 2733313


Ignore:
Timestamp:
05/29/2022 04:10:08 AM (4 years ago)
Author:
pseudozach
Message:

fix comment post error after payment

Location:
wp-lightning-comments/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-lightning-comments/trunk/lightningcomments.js

    r2732965 r2733313  
    11document.addEventListener('DOMContentLoaded', function(){
    22  var LightningComments = 'lncomments';
     3
     4  // // check localStorage if user previously paid and set the hidden value
     5  // var correctId = LightningComments + location.pathname + questions.map(function(q){return q.correct}).join('');
     6  // if(localStorage.getItem(correctId) === correctId){
     7  //   var fool = document.getElementById("pmg_comment_titlez");
     8  //   fool.value = "youreok";
     9  // }
    310
    411  var parseQuiz = function(str){
     
    1219    quizNode.style.height = '0px';
    1320
    14     console.log("removequiz setTimeout");
     21    // console.log("removequiz setTimeout");
    1522    quizNode.style.display = 'none';
    1623    formNode.style.height = 'auto';
     
    2532    formNode.style.height = formNode.scrollHeight + 'px';
    2633    quizNode.style.height = '0px';
    27     console.log("inside removequiz");
     34    // console.log("inside removequiz");
    2835    setTimeout(function(){
    2936      console.log("removequiz setTimeout");
     
    5461
    5562    if(localStorage.getItem(correctId) === correctId){  //Skip quiz if already solved
     63      var fool = document.getElementById("pmg_comment_titlez");
     64      fool.value = "youreok";
    5665      return quizNode.parentNode.removeChild(quizNode);
    5766    }
     
    8695
    8796    let invoice;
    88     const invoiceCheckInterval = 20000;
     97    const invoiceCheckInterval = 5000;
    8998
    9099    var invoiceDiv = document.createElement('div');
     
    129138            if(paid?.paid) {
    130139              localStorage.setItem(correctId, correctId);
     140              var fool = document.getElementById("pmg_comment_titlez");
     141              fool.value = "youreok";
    131142              setTimeout(removeQuizDelay, 2500, quizNode, formNode);
    132143              clearInterval(interval)
     
    147158        })
    148159        invoice = await invoiceResponse.json()
    149         console.log('notinvoice ', invoice)
     160        // console.log('notinvoice ', invoice)
    150161        const actualInvoiceResponse = await fetch(`${btcpayserverUrl}/api/v1/stores/${btcpayserverStoreId}/invoices/${invoice.id}/payment-methods`,
    151162        {
     
    174185            if(paid?.status === 'Settled') {
    175186              localStorage.setItem(correctId, correctId);
     187              var fool = document.getElementById("pmg_comment_titlez");
     188              fool.value = "youreok";
    176189              setTimeout(removeQuizDelay, 2500, quizNode, formNode);
    177190              clearInterval(interval)
  • wp-lightning-comments/trunk/lightningcomments.php

    r2732965 r2733313  
    22/*
    33Plugin Name: Pay to Comment with Lightning
    4 Version: 0.2.0
     4Version: 0.2.1
    55Plugin URI: https://wordpress.org/plugins/wp-lightning-comments/
    66Author: @citlayik
Note: See TracChangeset for help on using the changeset viewer.