Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrariofilippo committed Feb 15, 2023
2 parents 11b333e + 5ff230b commit 88073f7
Show file tree
Hide file tree
Showing 216 changed files with 120,103 additions and 118,696 deletions.
10 changes: 8 additions & 2 deletions builds/azure-pipelines-release.yml
Expand Up @@ -95,8 +95,8 @@ jobs:
inputs:
targetType: 'inline'
script: |
gci $(Build.SourcesDirectory)\src -Include app.xaml.cs -recurse | ForEach -Process {
(Get-Content $_ -Raw | ForEach -Process {$_ -replace "AppCenter.Start("", typeof(Analytics), typeof(Crashes));", "AppCenter.Start("$(appcenter.secret)", typeof(Analytics), typeof(Crashes));) | Set-Content $_ -NoNewline
gci $(Build.SourcesDirectory)\src -Include *.cs -recurse | ForEach -Process {
(Get-Content $_ -Raw | ForEach -Process {$_ -replace "appcenter.secret", "$(appcenter.secret)"}) | Set-Content $_ -NoNewline
}
failOnStderr: true

Expand Down Expand Up @@ -156,6 +156,12 @@ jobs:
ContainerName: 'files'
BlobPrefix: '${{parameters.releaseBranch}}'

- task: tfx-cloudflare-purge@1
inputs:
username: '$(cloudflare.username)'
apikey: '$(cloudflare.apikey)'
zonename: '$(cloudflare.zoneid)'

### Store release ###
- job: StoreRelease
timeoutInMinutes: 120
Expand Down
13 changes: 0 additions & 13 deletions builds/azure-pipelines.yml
Expand Up @@ -46,19 +46,6 @@ steps:
TargetFolder: '$(Build.SourcesDirectory)\src\Files.App\Resources'
overWrite: true

- task: DownloadSecureFile@1
name: appCenterDevKey
displayName: 'Download AppCenter Dev Key'
inputs:
secureFile: 'AppCenterKey.txt'

- task: CopyFiles@2
inputs:
SourceFolder: '$(Agent.TempDirectory)'
Contents: '$(appCenterDevKey.secureFilePath)'
TargetFolder: '$(Build.SourcesDirectory)\src\Files.App\Resources'
overWrite: true

- task: UseDotNet@2
inputs:
packageType: sdk
Expand Down
16 changes: 13 additions & 3 deletions src/Files.App/App.xaml.cs
Expand Up @@ -2,7 +2,6 @@
using CommunityToolkit.WinUI;
using CommunityToolkit.WinUI.Helpers;
using CommunityToolkit.WinUI.Notifications;
using Files.App.Controllers;
using Files.App.DataModels;
using Files.App.Extensions;
using Files.App.Filesystem;
Expand Down Expand Up @@ -30,6 +29,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.Windows.AppLifecycle;
using System;
using System.Diagnostics;
Expand All @@ -54,6 +54,7 @@ public partial class App : Application
private static bool ShowErrorNotification = false;

public static string OutputPath { get; set; }
public static CommandBarFlyout? LastOpenedFlyout { get; set; }
public static StorageHistoryWrapper HistoryWrapper = new StorageHistoryWrapper();
public static SettingsViewModel AppSettings { get; private set; }
public static AppModel AppModel { get; private set; }
Expand Down Expand Up @@ -95,7 +96,7 @@ public App()
Services = ConfigureServices();
Ioc.Default.ConfigureServices(Services);
LogoPath = Package.Current.DisplayName == "Files - Dev" ? Constants.AssetPaths.DevLogo
: (Package.Current.DisplayName == "Files - Preview" ? Constants.AssetPaths.PreviewLogo : Constants.AssetPaths.StableLogo);
: (Package.Current.DisplayName == "Files (Preview)" ? Constants.AssetPaths.PreviewLogo : Constants.AssetPaths.StableLogo);
}

private IServiceProvider ConfigureServices()
Expand Down Expand Up @@ -177,7 +178,7 @@ private static Task StartAppCenter()
{
// AppCenter secret is injected in builds/azure-pipelines-release.yml
if (!AppCenter.Configured)
AppCenter.Start("", typeof(Analytics), typeof(Crashes));
AppCenter.Start("appcenter.secret", typeof(Analytics), typeof(Crashes));
}
catch (Exception ex)
{
Expand Down Expand Up @@ -287,6 +288,15 @@ private async void Window_Closed(object sender, WindowEventArgs args)
{
// Save application state and stop any background activity

// A Workaround for the crash (#10110)
if (LastOpenedFlyout?.IsOpen ?? false)
{
args.Handled = true;
LastOpenedFlyout.Closed += (sender, e) => App.Current.Exit();
LastOpenedFlyout.Hide();
return;
}

await Task.Yield(); // Method can take a long time, make sure the window is hidden

SaveSessionTabs();
Expand Down

0 comments on commit 88073f7

Please sign in to comment.