Skip to content

Commit

Permalink
Add quick setup
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmayer-dev committed May 13, 2024
1 parent 363c55b commit 47af3d1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {
implementation project(':capacitor-keyboard')
implementation project(':capawesome-capacitor-screen-orientation')
implementation project(':sslhandler')
implementation "androidx.exifinterface:exifinterface:1.2.0"

}


Expand Down
2 changes: 1 addition & 1 deletion ios/App/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ SPEC CHECKSUMS:
CapacitorHaptics: 7c7c206f0c96a628fed073830c96d28c4b2e772e
CapacitorKeyboard: aec619a578235c6ce279075009a2689c2cf5c42c
CapawesomeCapacitorScreenOrientation: a757a72cd4a113142638c049af61441793721f07
CordovaPlugins: 335e584d47267c702c76d59ff99face9ed48cbe8
CordovaPlugins: d4671f1d2a1af985cd35caa0d8bbb58b95ef3c70
Sslhandler: 5b1dfaa41fdbad6e788cea98538cb0c2995b9153

PODFILE CHECKSUM: da7bb84d682684c56c1176daada29c914a7af786
Expand Down
1 change: 1 addition & 0 deletions src/app/pages/home/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class HomePage implements OnInit, ViewWillEnter, ViewDidEnter, ViewDidLea
useSsl: existingConnection?.ssl ?? false,
autoConnect: existingConnection?.autoConnect ?? false,
index: existingConnection?.index ?? 0,
editConnection: true
};
} else if (quickSetupQrCodeData) {
props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
<ion-buttons slot="start">
<ion-button (click)="cancel()">Cancel</ion-button>
</ion-buttons>
<ion-title>Add connection</ion-title>
@if (host.length > 0) {
@if (editConnection) {
<ion-title>Edit connection</ion-title>
} @else {
<ion-title>Add connection</ion-title>
}
@if (host.length > 0 && port > 1) {
<ion-buttons slot="end">
<ion-button (click)="confirm()" [strong]="true">Confirm</ion-button>
</ion-buttons>
Expand All @@ -13,7 +17,7 @@
</ion-header>

<ion-content class="ion-padding">
@if (quickSetupQrCodeData === undefined) {
@if (quickSetupQrCodeData === undefined && !editConnection) {
<ion-segment [(ngModel)]="page" value="quick-setup">
<ion-segment-button value="quick-setup">
<ion-label>Quick Setup</ion-label>
Expand All @@ -24,7 +28,7 @@
</ion-segment>
}

@if (page === "quick-setup") {
@if (page === "quick-setup" && !editConnection) {
@if (quickSetupQrCodeData !== undefined) {
<ng-template [ngTemplateOutlet]="generalConnectionInfo"/>

Expand Down Expand Up @@ -77,6 +81,6 @@
</ion-input>
</ion-item>
<ion-item>
<ion-toggle [(ngModel)]="autoConnect">Automatically connect</ion-toggle>
<ion-toggle [(ngModel)]="autoConnect">Connect automatically</ion-toggle>
</ion-item>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {ConnectionFailedComponent} from "../connection-failed/connection-failed.
})
export class AddConnectionComponent implements OnInit, OnDestroy {

editConnection: boolean = false;
quickSetupQrCodeData: QuickSetupQrCodeData | undefined;
id: string = "";
name: string | undefined;
Expand All @@ -36,7 +37,7 @@ export class AddConnectionComponent implements OnInit, OnDestroy {
}

async ngOnInit() {
if (this.diagnosticService.isiOSorAndroid()) {
if (this.diagnosticService.isiOSorAndroid() && !this.editConnection) {
this.subscription.add(QrCodeScannerComponent.quickSetupQrCodeScanned.subscribe(async qrCodeScanner => {
const dataBase64 = qrCodeScanner.split("quick-setup/").pop();
if (dataBase64) {
Expand Down

0 comments on commit 47af3d1

Please sign in to comment.