Forráskód Böngészése

Added update profile dot

Krzysztof Krysiński 4 hónapja
szülő
commit
29a555a3fd

+ 2 - 0
src/PixiEditor/ViewModels/SubViewModels/UserViewModel.cs

@@ -90,6 +90,7 @@ internal class UserViewModel : SubViewModel<ViewModelMain>
     public string? AvatarUrl => IdentityProvider.User?.AvatarUrl;
 
     public bool NonDefaultIdentityProvider => IdentityProvider is not PixiAuthIdentityProvider;
+    public bool AnyUpdateAvailable => OwnedProducts.Any(x => x.UpdateAvailable);
 
     public UserViewModel(ViewModelMain owner) : base(owner)
     {
@@ -365,6 +366,7 @@ internal class UserViewModel : SubViewModel<ViewModelMain>
         OnPropertyChanged(nameof(AvatarUrl));
         OnPropertyChanged(nameof(EmailEqualsLastSentMail));
         OnPropertyChanged(nameof(OwnedProducts));
+        OnPropertyChanged(nameof(AnyUpdateAvailable));
         ResendActivationCommand.NotifyCanExecuteChanged();
     }
 }

+ 9 - 1
src/PixiEditor/ViewModels/User/OwnedProductViewModel.cs

@@ -60,10 +60,18 @@ public class OwnedProductViewModel : ObservableObject
             async () =>
             {
                 IsInstalling = true;
+                bool wasUpdating = UpdateAvailable;
                 UpdateAvailable = false;
                 await installContentCommand.ExecuteAsync(ProductData.Id);
                 IsInstalling = false;
-                RestartRequired = true;
+                if (wasUpdating)
+                {
+                    RestartRequired = true;
+                }
+                else
+                {
+                    IsInstalled = isInstalledFunc(ProductData.Id);
+                }
             }, () => !IsInstalled && !IsInstalling || UpdateAvailable);
     }
 }

+ 18 - 1
src/PixiEditor/Views/Auth/UserAvatarToggle.axaml

@@ -109,7 +109,7 @@
                                                     IsVisible="{Binding RestartRequired}"
                                                     ui:Translator.Key="RESTART"
                                                     Background="{DynamicResource ThemeAccentBrush}"
-                                                    Command="{xaml:Command Name=PixiEditor.Restart}"/>
+                                                    Command="{xaml:Command Name=PixiEditor.Restart}" />
                                         </DockPanel>
                                     </DataTemplate>
                                 </ItemsControl.ItemTemplate>
@@ -117,12 +117,29 @@
 
                             <Button Margin="0, 24, 0, 0"
                                     Content="{ui:Translate Key=LOGOUT}"
+                                    IsVisible="{Binding IdentityProvider.AllowsLogout}"
                                     Command="{Binding LogoutCommand}" />
+
+                            <TextBlock Classes="subtext" HorizontalAlignment="Center"
+                                       Margin="0, 12, 0, 0"
+                                       IsVisible="{Binding NonDefaultIdentityProvider}">
+                                <Run Text="{ui:Translate Key=ACCOUNT_PROVIDER_INFO}" />
+                                <Run Text="{Binding IdentityProvider.ProviderName}" />
+                            </TextBlock>
                         </StackPanel>
                     </Flyout>
                 </Button.Flyout>
             </Button>
         </Border>
+
+        <Ellipse IsVisible="{Binding AnyUpdateAvailable}"
+                   ClipToBounds="False"
+                   Width="12" Height="12"
+                   HorizontalAlignment="Right"
+                   VerticalAlignment="Bottom"
+                   StrokeThickness="2"
+                   Stroke="{DynamicResource ThemeBackgroundBrush}"
+                   Fill="{DynamicResource ThemeAccent3Brush}" />
         <Button IsVisible="{Binding !IsLoggedIn}"
                 Classes="pixi-icon"
                 Content="{DynamicResource icon-user}"