Skip to content

Commit

Permalink
Further cleanup of establishConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
ckosmowski committed Nov 16, 2018
1 parent 67ff25f commit 13ed477
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/FinTSClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,20 +564,7 @@ export class FinTSClient {
if (step === 1 || step === 2) {
// Im Step 1 und 2 bleiben keine Verbindungen erhalten
// Diese Verbindung auf jeden Fall beenden
const neuUrl = this.bpd.url;
const neuSigMethod = this.upd.availableTanVerfahren[0];
this.bpd = originalBpd.clone();
this.upd = originalUpd.clone();
const origSysId = this.sysId;
const origLastSig = this.lastSignaturId;
this.endDialogIfNotCanceled(recvMsg);
this.clear();
this.bpd.url = neuUrl;
this.upd.availableTanVerfahren[0] = neuSigMethod;
this.sysId = origSysId;
this.lastSignaturId = origLastSig;
originalBpd.url = this.bpd.url;
originalUpd.availableTanVerfahren[0] = neuSigMethod;
this.resetConnection(originalBpd, originalUpd, recvMsg);
}

if (hasNewUrl) {
Expand Down Expand Up @@ -1012,6 +999,23 @@ export class FinTSClient {
});
}

private resetConnection(originalBpd, originalUpd, recvMsg) {
const neuUrl = this.bpd.url;
const neuSigMethod = this.upd.availableTanVerfahren[0];
this.bpd = originalBpd.clone();
this.upd = originalUpd.clone();
const origSysId = this.sysId;
const origLastSig = this.lastSignaturId;
this.endDialogIfNotCanceled(recvMsg);
this.clear();
this.bpd.url = neuUrl;
this.upd.availableTanVerfahren[0] = neuSigMethod;
this.sysId = origSysId;
this.lastSignaturId = origLastSig;
originalBpd.url = this.bpd.url;
originalUpd.availableTanVerfahren[0] = neuSigMethod;
}

private debugLogMsg = (txt, send) => {
this.conLog.trace({
raw_data: txt,
Expand Down

0 comments on commit 13ed477

Please sign in to comment.