Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Explorer/Assets/DCL/ExplorePanel/BackpackDeepLinkOpener.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Cysharp.Threading.Tasks;
using DCL.Diagnostics;
using DCL.RealmNavigation;
using DCL.UI;
using MVC;
using System;
using System.Threading;

namespace DCL.ExplorePanel
{
public static class BackpackDeepLinkOpener
{
public static async UniTaskVoid OpenBackpackWhenLandedAsync(IMVCManager mvcManager, ILoadingStatus loadingStatus, CancellationToken ct)
{
try
{
await UniTask.WaitUntil(() => loadingStatus.CurrentStage.Value == LoadingStatus.LoadingStage.Completed, cancellationToken: ct);
await mvcManager.ShowAsync(ExplorePanelController.IssueCommand(new ExplorePanelParameter(ExploreSections.Backpack)), ct);
}
catch (OperationCanceledException) { }
catch (Exception e) { ReportHub.LogException(e, ReportCategory.UI); }
}
}
}
11 changes: 11 additions & 0 deletions Explorer/Assets/DCL/ExplorePanel/BackpackDeepLinkOpener.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public static class AppArgsFlags
/// </summary>
public const string COMMUNITY = "community";

public const string FORCE_OPEN_BACKPACK = "force-open-backpack";
Comment thread
davidejensen marked this conversation as resolved.

// The opaque identity id delivered by the auth website's signin deep link (<c>decentraland://?signin={identityId}</c>).
public const string SIGNIN = "signin";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ await MapRendererContainer

// Deep link listening stays alive in every mode so browser sign-in can complete; local scene
// development only opts out of navigation routing (teleports would break the scene under test).
var deepLinkHandleImplementation = new DeepLinkHandle(dynamicWorldParams.StartParcel, chatContainer.ChatTeleporter, ct, communitiesDataService, bootstrapContainer.DeeplinkSigninIdentityId,
var deepLinkHandleImplementation = new DeepLinkHandle(dynamicWorldParams.StartParcel, chatContainer.ChatTeleporter, ct, communitiesDataService, uiShellContainer.MvcManager, staticContainer.LoadingStatus, bootstrapContainer.DeeplinkSigninIdentityId,
bootstrapContainer.DeeplinkLoginAwaitingSigninRequestId, routeNavigationDeepLinks: !appArgs.HasFlag(AppArgsFlags.LOCAL_SCENE));

deepLinkHandleImplementation.StartListenForDeepLinksAsync(ct).Forget();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ private async UniTaskVoid CheckForSidebarButtonStateAsync(CancellationToken ct)

if (!creditsProgramProgressResponse.HasUserStartedProgram() || TrySetAsShownThisWeek(creditsProgramProgressResponse))
{
// Open the Marketplace Credits panel by default when the user didn't start the program and has landed in Genesis City.
await UniTask.WaitUntil(() => loadingStatus.CurrentStage.Value == LoadingStatus.LoadingStage.Completed && realmData.IsGenesis(), cancellationToken: ct);
// Open the Marketplace Credits panel by default when the user didn't start the program and has landed in Genesis City,
// holding off while any other popup or fullscreen view is on screen (e.g. the backpack opened via force-open-backpack).
await UniTask.WaitUntil(() => loadingStatus.CurrentStage.Value == LoadingStatus.LoadingStage.Completed && realmData.IsGenesis() && !mvcManager.IsAnyModalViewShowing(), cancellationToken: ct);
await mvcManager.ShowAsync(MarketplaceCreditsMenuController.IssueCommand(new Params(isOpenedFromNotification: false)), ct);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,9 @@ public async UniTask InitializeAsync(ExplorePanelSettings settings, Cancellation

if (isCommunitiesFeatureEnabled)
dclInput.Shortcuts.Communities.performed += OnInputShortcutsCommunitiesPerformed;

if (appArgs.HasFlag(AppArgsFlags.FORCE_OPEN_BACKPACK))
BackpackDeepLinkOpener.OpenBackpackWhenLandedAsync(mvcManager, loadingStatus, ct).Forget();
}

private async UniTask<ObjectPool<PlaceElementView>> InitializePlaceElementsPoolAsync(SearchResultPanelView view, CancellationToken ct)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
using Cysharp.Threading.Tasks;
using DCL.Chat.Commands;
using DCL.Communities;
using DCL.ExplorePanel;
using DCL.Diagnostics;
using DCL.RealmNavigation;
using DCL.Utilities;
using Global.AppArgs;
using MVC;
using System.Threading;
using UnityEngine;

Expand All @@ -17,17 +19,21 @@ public class DeepLinkHandle : IDeepLinkHandle
private readonly ChatTeleporter chatTeleporter;
private readonly CancellationToken token;
private readonly CommunityDataService communityDataService;
private readonly IMVCManager mvcManager;
private readonly ILoadingStatus loadingStatus;
private readonly ReactiveProperty<string?> deeplinkSigninIdentityId;
private readonly IReadonlyReactiveProperty<string?> loginAwaitingSigninRequestId;
private readonly bool routeNavigationDeepLinks;

public DeepLinkHandle(StartParcel startParcel, ChatTeleporter chatTeleporter, CancellationToken token, CommunityDataService communityDataService, ReactiveProperty<string?> deeplinkSigninIdentityId,
public DeepLinkHandle(StartParcel startParcel, ChatTeleporter chatTeleporter, CancellationToken token, CommunityDataService communityDataService, IMVCManager mvcManager, ILoadingStatus loadingStatus, ReactiveProperty<string?> deeplinkSigninIdentityId,
IReadonlyReactiveProperty<string?> loginAwaitingSigninRequestId, bool routeNavigationDeepLinks)
{
this.startParcel = startParcel;
this.chatTeleporter = chatTeleporter;
this.token = token;
this.communityDataService = communityDataService;
this.mvcManager = mvcManager;
this.loadingStatus = loadingStatus;
this.deeplinkSigninIdentityId = deeplinkSigninIdentityId;
this.loginAwaitingSigninRequestId = loginAwaitingSigninRequestId;
this.routeNavigationDeepLinks = routeNavigationDeepLinks;
Expand Down Expand Up @@ -90,6 +96,12 @@ public DeepLinkHandleResult HandleDeepLink(DeepLink deeplink)
handled = true;
}

if (deeplink.ValueOf(AppArgsFlags.FORCE_OPEN_BACKPACK) != null)
{
BackpackDeepLinkOpener.OpenBackpackWhenLandedAsync(mvcManager, loadingStatus, token).Forget();
handled = true;
}

return handled ? DeepLinkHandleResult.CONSUMED : DeepLinkHandleResult.NO_MATCHES;
}

Expand Down
15 changes: 15 additions & 0 deletions docs/app-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,21 @@ More detailed instructions on how to test can be found in the description of rel

---

## UI Flags

### `force-open-backpack`
**Description:** Automatically opens the Backpack panel once the user lands in the world (after authentication and the loading screen). Presence-only: any value triggers it. Also works when a deep link reaches an already-running client — the Backpack opens immediately (or once loading completes).

**Usage:**
```bash
--force-open-backpack
```
```
decentraland://?force-open-backpack=true
```

---

## Performance & Caching Flags

### `disable-disk-cache`
Expand Down
Loading