Skip to content

Commit

Permalink
Updated QR panel to fix broken copy sync id since syncinfo changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nero120 committed Apr 28, 2022
1 parent 64e1397 commit 6e807d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
"node_modules": true
},
"stylelint.enable": true,
"stylelint.validate": ["css", "html", "markdown", "sass", "scss"],
"stylelint.validate": ["markdown", "scss"],
"typescript.tsdk": "./node_modules/typescript/lib"
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@
"SharedArrayBuffer": "readonly"
},
"ignorePatterns": [
"build/",
"dist/"
"**/build/*",
"**/dist/*",
"**/node_modules/*"
],
"parserOptions": {
"ecmaVersion": 2020,
Expand Down
13 changes: 8 additions & 5 deletions src/modules/app/app-settings/qr-panel/qr-panel.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Component, OnInit, Output } from 'angular-ts-decorators';
import { boundMethod } from 'autobind-decorator';
import QRCode from 'qrcode-svg';
import { ApiSyncInfo } from '../../../shared/api/api.interface';
import { BackupRestoreService } from '../../../shared/backup-restore/backup-restore.service';
import { PlatformService } from '../../../shared/global-shared.interface';
import { StoreKey } from '../../../shared/store/store.enum';
import { StoreService } from '../../../shared/store/store.service';
import { UtilityService } from '../../../shared/utility/utility.service';
import { AppHelperService } from '../../shared/app-helper/app-helper.service';
Expand All @@ -23,8 +25,6 @@ export class AppQrComponent implements OnInit {
storeSvc: StoreService;
utilitySvc: UtilityService;

serviceUrl: string;
syncId: string;
syncIdCopied = false;

@Output() close: () => void;
Expand Down Expand Up @@ -55,9 +55,12 @@ export class AppQrComponent implements OnInit {

@boundMethod
copySyncId(): void {
this.appHelperSvc.copyTextToClipboard(this.syncId).then(() => {
this.syncIdCopied = true;
});
this.storeSvc
.get<ApiSyncInfo>(StoreKey.SyncInfo)
.then((syncInfo) => this.appHelperSvc.copyTextToClipboard(syncInfo.id))
.then(() => {
this.syncIdCopied = true;
});
}

ngOnInit(): void {
Expand Down

0 comments on commit 6e807d0

Please sign in to comment.