Skip to content

Commit

Permalink
Merge branch 'steam-beta' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Nov 24, 2023
2 parents 8a8a8d3 + 01a6c50 commit 27f9356
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src-ui/app/services/vrchat.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { migrateVRChatApiSettings } from '../migrations/vrchat-api-settings.migr
import {
BehaviorSubject,
combineLatest,
debounceTime,
distinctUntilChanged,
filter,
interval,
Expand Down Expand Up @@ -130,6 +131,8 @@ export class VRChatService {
this._vrchatProcessActive.next(event.payload)
);
this._vrchatProcessActive.next(await invoke<boolean>('is_vrchat_active'));
// Handle login side effects
await this.handleLoginSideEffects();
}

//
Expand Down Expand Up @@ -444,6 +447,15 @@ export class VRChatService {
// INTERNALS
//

private async handleLoginSideEffects() {
this._status.pipe(distinctUntilChanged(), debounceTime(500)).subscribe((loggedIn) => {
if (loggedIn) {
// List friends on login to make sure they are cached
this.listFriends();
}
});
}

private async pollUserForStatus() {
interval(5000).subscribe(async () => {
if (this._status.value !== 'LOGGED_IN' || !this._user.value) return;
Expand Down

0 comments on commit 27f9356

Please sign in to comment.