Skip to content

Commit

Permalink
Fix pulsoid account linking
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Oct 30, 2024
1 parent d2a2b55 commit caea0d1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- GPU acceleration for SteamVR overlays (Community contribution by [BenjaminZehowlt](https://github.com/BenjaminZehowlt))

### Fixed

- Linking your Pulsoid account through the Pulsoid integration no longer functioning.

## [1.14.4]

### Fixed
Expand Down
16 changes: 13 additions & 3 deletions src-ui/app/services/deep-link.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { listen } from '@tauri-apps/api/event';
import { warn } from 'tauri-plugin-log-api';
import { info, warn } from 'tauri-plugin-log-api';
import { PulsoidService } from './integrations/pulsoid.service';

@Injectable({
Expand All @@ -12,21 +12,27 @@ export class DeepLinkService {
async init() {
await listen<string>('onDeepLinkCall', async (event) => {
let url: URL | null = null;
info(`[DeepLinkService] Received deep link call: ${event.payload}`);
try {
url = new URL(event.payload);
} catch (e) {
await warn(`[DeepLinkService] Failed to parse deep link URL: ${event.payload}`);
return;
}
await this.handleDeepLinkCall(url);
try {
await this.handleDeepLinkCall(url);
} catch (e) {
await warn(`[DeepLinkService] Failed to handle deep link call for URL: ${event.payload}`);
}
});
}

private async handleDeepLinkCall(url: URL) {
let pathname = url.pathname;
console.log(url);
// Remove any leading slashes
while (pathname.startsWith('/')) pathname = pathname.substring(1);
const route = pathname.split('/');
const route = [url.hostname, ...pathname.split('/')];
switch (route[0]) {
case 'integration':
if (route.length < 2) break;
Expand All @@ -41,6 +47,8 @@ export class DeepLinkService {
url.hash.substring(1)
);
break;
default:
await warn(`[DeepLinkService] Couldn't handle deep link type: ${route[0]}`);
}
}

Expand All @@ -63,6 +71,8 @@ export class DeepLinkService {
case 'pulsoid':
await this.pulsoid.handleDeepLink(path, params, fragmentParams);
break;
default:
await warn(`[DeepLinkService] Couldn't handle deep link for integration: ${integration}`);
}
}
}

0 comments on commit caea0d1

Please sign in to comment.