Skip to content
Snippets Groups Projects
Commit 3a516345 authored by Klaus-Dieter Quibeldey-Cirkel's avatar Klaus-Dieter Quibeldey-Cirkel
Browse files

Merge branch '535-fix-session-code-segmentation-in-qr-code-dialog' into 'master'

decode key for qr dialog

Closes #535

See merge request arsnova/frag.jetzt!487
parents ae0833d0 2a72dc45
No related merge requests found
......@@ -5,7 +5,7 @@
</button>
<div>
<h2>frag.jetzt</h2>
<h2>{{'qr-dialog.session' | translate}}: {{key.slice(0, 4)}} {{key.slice(4, 8)}}</h2>
<h2>{{'qr-dialog.session' | translate}}: {{key}}</h2>
</div>
<qrcode [qrdata]="data" [width]="qrWidth" [errorCorrectionLevel]="'M'"></qrcode>
</div>
......
......@@ -20,6 +20,7 @@ import { RemindOfTokensComponent } from '../../participant/_dialogs/remind-of-to
import { QrCodeDialogComponent } from '../_dialogs/qr-code-dialog/qr-code-dialog.component';
import { BonusTokenService } from '../../../services/http/bonus-token.service';
import { MotdService } from '../../../services/http/motd.service';
import { RoomService } from '../../../services/http/room.service';
@Component({
selector: 'app-header',
......@@ -97,8 +98,10 @@ export class HeaderComponent implements OnInit {
/* segments gets all parts of the url */
const segments = this.router.parseUrl(this.router.url).root.children.primary.segments;
if (segments && segments.length > 2) {
this.shortId = segments[2].toString();
localStorage.setItem('shortId', this.shortId);
if (!segments[2].path.includes('%')) {
this.shortId = segments[2].path;
localStorage.setItem('shortId', this.shortId);
}
}
}
});
......@@ -240,7 +243,7 @@ export class HeaderComponent implements OnInit {
});
const url = this.getURL();
dialogRef.componentInstance.data = url;
dialogRef.componentInstance.key = url.slice(-8);
dialogRef.componentInstance.key = this.shortId;
dialogRef.afterClosed().subscribe(res => {
Rescale.exitFullscreen();
});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment