Skip to content

Commit

Permalink
Fix swipe gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmayer-dev committed May 1, 2024
1 parent 4ddb03e commit 9659308
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
24 changes: 12 additions & 12 deletions ios/App/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- Capacitor (5.2.3):
- Capacitor (5.7.5):
- CapacitorCordova
- CapacitorApp (5.0.6):
- CapacitorApp (5.0.7):
- Capacitor
- CapacitorCommunityKeepAwake (4.0.0):
- Capacitor
- CapacitorCordova (5.2.3)
- CapacitorHaptics (5.0.6):
- CapacitorCordova (5.7.5)
- CapacitorHaptics (5.0.7):
- Capacitor
- CapacitorKeyboard (5.0.6):
- CapacitorKeyboard (5.0.8):
- Capacitor
- CapawesomeCapacitorScreenOrientation (6.0.0):
- CapawesomeCapacitorScreenOrientation (5.0.1):
- Capacitor
- CordovaPlugins (5.2.3):
- CapacitorCordova
Expand Down Expand Up @@ -49,13 +49,13 @@ EXTERNAL SOURCES:
:path: "../../node_modules/sslhandler"

SPEC CHECKSUMS:
Capacitor: 6f44cbc33839b8a4202b8eac97041fe584083417
CapacitorApp: 024e1b1bea5f883d79f6330d309bc441c88ad04a
Capacitor: 7d42085cb786b2d3ea9ac8a17ebd7e3305be7b72
CapacitorApp: 17fecd0e6cb23feafac7eb0939417389038b0979
CapacitorCommunityKeepAwake: f3442e3e9b666dd0162522fbd053da1fe81ede20
CapacitorCordova: 35def3ebfdef491f0a7b652816eb873ff4b20bbf
CapacitorHaptics: 1fffc1217c7e64a472d7845be50fb0c2f7d4204c
CapacitorKeyboard: b978154b024a5f65e044908e37d15b7de58b9d12
CapawesomeCapacitorScreenOrientation: 82675c41cb616a64630c834b06344515a2849ff3
CapacitorCordova: c946a6052b547e1e185fc46862003f7b9130ead1
CapacitorHaptics: 7c7c206f0c96a628fed073830c96d28c4b2e772e
CapacitorKeyboard: aec619a578235c6ce279075009a2689c2cf5c42c
CapawesomeCapacitorScreenOrientation: a757a72cd4a113142638c049af61441793721f07
CordovaPlugins: d4671f1d2a1af985cd35caa0d8bbb58b95ef3c70
Sslhandler: 5b1dfaa41fdbad6e788cea98538cb0c2995b9153

Expand Down
2 changes: 1 addition & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {HttpClientModule} from "@angular/common/http";
imports: [
BrowserModule,
HttpClientModule,
IonicModule.forRoot(),
IonicModule.forRoot({swipeBackEnabled: false}),
IonicStorageModule.forRoot(),
AppRoutingModule,
FormsModule,
Expand Down
4 changes: 0 additions & 4 deletions src/app/pages/home/connections/connections.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export class ConnectionsPage implements OnInit, OnDestroy {
savedConnectionsInitialized = false;
reorderEnabled: boolean = true;

lastConnection: Connection | undefined;

constructor(private connectionService: ConnectionService,
private modalController: ModalController,
private alertController: AlertController,
Expand Down Expand Up @@ -65,8 +63,6 @@ export class ConnectionsPage implements OnInit, OnDestroy {
private async loadConnections() {
this.savedConnections = await this.connectionService.getConnections() ?? [];
this.savedConnectionsInitialized = true;
const lastConnectionId = await this.settingsService.getLastConnection();
this.lastConnection = this.savedConnections.filter(x => x.id == lastConnectionId)[0];
}

async openAddConnectionModal(existingConnection?: Connection | null) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/services/ping/ping.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class PingService {
this.subscription = new Subscription();
let connections = await this.connectionService.getConnections();
for (const connection of connections) {
this.subscription.add(this.periodicRequest(this.getPingUrl(connection), 1000).subscribe(response => {
this.subscription.add(this.periodicRequest(this.getPingUrl(connection), 1500).subscribe(response => {
if (response !== null) {
this.addAvailableConnection(connection);
} else {
Expand Down Expand Up @@ -68,7 +68,7 @@ export class PingService {
private periodicRequest(url: string, intervalTime: number): Observable<any> {
return interval(intervalTime).pipe(
switchMap(() => this.http.get(url).pipe(
timeout(500),
timeout(800),
catchError(error => {
return of(null);
})
Expand Down
8 changes: 8 additions & 0 deletions src/app/services/websocket/websocket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {environment} from "../../../environments/environment";
export class WebsocketService {
public isConnected: Boolean = false;

private connecting: boolean = false;
private closing: boolean = false;
private url: string = "";
private connectionId: string | undefined;
Expand Down Expand Up @@ -70,6 +71,7 @@ export class WebsocketService {
error: async error => {
await this.loadingService.dismiss();
this.closed.emit();
this.connecting = false;
if (error instanceof DOMException) {
switch (error.name) {
case "SecurityError":
Expand All @@ -82,6 +84,10 @@ export class WebsocketService {
}

public async connect(host: string, port: number, secure: boolean, id: string) {
if (this.connecting || this.isConnected) {
return;
}

await this.connectToString((secure ? "wss://" : "ws://") + host + ":" + port);
this.connectionId = id;
}
Expand All @@ -92,6 +98,7 @@ export class WebsocketService {
await this.loadingService.dismiss();
this.subscription.unsubscribe();
this.closed.emit();
this.connecting = false;

if (!this.closing) {
await this.handleError(closeEvent);
Expand All @@ -103,6 +110,7 @@ export class WebsocketService {

this.connectionOpened.subscribe(async () => {
this.connected.emit();
this.connecting = false;
await this.settingsService.increaseConnectionCount();
await this.settingsService.setLastConnection(this.connectionId ?? "");
this.protocolHandlerService.setWebsocketSubject(this.socket!);
Expand Down

0 comments on commit 9659308

Please sign in to comment.