| Line 4: |
Line 4: |
| | | | |
| | function idxdbContainer( ww ) { | | function idxdbContainer( ww ) { |
| − | | + | var DEBUG = false; |
| | hashCode = function(s) { | | hashCode = function(s) { |
| | if ( s == undefined) { | | if ( s == undefined) { |
| Line 36: |
Line 36: |
| | // External accessible wrapper for Enquire | | // External accessible wrapper for Enquire |
| | | | |
| − | this.EnqueuePDIO = async function( sw, c1, c2, c3 ) { | + | this.EnqueuePDIO = function( sw, c1, c2, c3 ) { |
| | var k = await Enquire( PersonalDataDataBaseName, this.CurrentPerson, sw, c1, c2, c3 ); | | var k = await Enquire( PersonalDataDataBaseName, this.CurrentPerson, sw, c1, c2, c3 ); |
| − | console.log("Mark K");
| |
| − | console.log(k);
| |
| | return k; | | return k; |
| | } | | } |
| Line 60: |
Line 58: |
| | // retrieve record, make record.field1 = field2, push back | | // retrieve record, make record.field1 = field2, push back |
| | | | |
| − | function Enquire( pddbname, record, sqitch, control_1, control_2, control_3 ) { | + | async function Enquire( pddbname, record, sqitch, control_1, control_2, control_3 ) { |
| | return new Promise( | | return new Promise( |
| | function(resolve, reject) { | | function(resolve, reject) { |
| Line 84: |
Line 82: |
| | | | |
| | getRecord.onsuccess = function() { | | getRecord.onsuccess = function() { |
| − | console.log( "Record found in database: \n <<"); | + | if ( DEBUG ) { |
| − | console.log( getRecord.result );
| + | console.log( "Record found in database: \n <<"); |
| − | console.log( ">>");
| + | console.log( getRecord.result ); |
| − | | + | console.log( ">>"); |
| | + | } |
| | // Essential recordAdd | | // Essential recordAdd |
| | if ( sqitch === "aggressive push" ) { | | if ( sqitch === "aggressive push" ) { |
| Line 96: |
Line 95: |
| | | | |
| | if ( getRecord.result != undefined ) { | | if ( getRecord.result != undefined ) { |
| − | console.log("getting from store"); | + | if ( DEBUG ) { |
| | + | console.log("getting from store"); |
| | + | } |
| | inp_obj = getRecord.result; | | inp_obj = getRecord.result; |
| | } else { | | } else { |
| − | console.log("overriding whatever in there"); | + | if ( DEBUG ) { |
| | + | console.log("overriding whatever in there"); |
| | + | } |
| | inp_obj = record; | | inp_obj = record; |
| | store.put(inp_obj); | | store.put(inp_obj); |