Skip to content

Commit

Permalink
feat: on success and on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sosweetham committed Aug 18, 2024
1 parent f166caa commit f9f0ab7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/qr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ import QRCodeStyling, { Options } from "qr-code-styling";

export default class OpenIdQr {
private _qrOptions: Options;
private _onSuccess: () => void;
private _onFailure: () => void;
public qr: QRCodeStyling;
constructor(qrOptions: Options, requestUri: string) {
constructor(
qrOptions: Options,
requestUri: string,
onSuccess: () => void,
onFailure: () => void
) {
this._qrOptions = qrOptions;
this._onSuccess = onSuccess;
this._onFailure = onFailure;
this.qr = new QRCodeStyling({ ...this._qrOptions, data: requestUri });
}
}

0 comments on commit f9f0ab7

Please sign in to comment.