Skip to content

Commit

Permalink
Fixed issues from appcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Apr 21, 2023
1 parent 6eb0591 commit 88447e6
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
12 changes: 11 additions & 1 deletion Telegram/Common/PlaceholderHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ public static async Task<CanvasBitmap> GetPatternBitmapAsync(ICanvasResourceCrea
var cache = $"{file.Remote.UniqueId}.cache.png";
var relative = System.IO.Path.Combine("wallpapers", cache);

var delete = false;

var item = await ApplicationData.Current.LocalFolder.TryGetItemAsync(relative) as StorageFile;
if (item == null)
{
Expand All @@ -296,10 +298,18 @@ public static async Task<CanvasBitmap> GetPatternBitmapAsync(ICanvasResourceCrea
{
bitmap = await CanvasBitmap.LoadAsync(resourceCreator, stream);
}
catch { }
catch
{
delete = true;
}
}
}

if (item != null && delete)
{
await item.DeleteAsync();
}

return bitmap;
}

Expand Down
10 changes: 0 additions & 10 deletions Telegram/Common/PowerSavingPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@ private static void UpdatePolicy()
_ => false
};

#if !DEBUG
Microsoft.AppCenter.Analytics.Analytics.TrackEvent("Capabilities",
new System.Collections.Generic.Dictionary<string, string>
{
{ "InEnergySaverMode", isEnergySaverMode.ToString() },
{ "AreEffectsFast", areEffectsFast.ToString() },
{ "AdvancedEffectsEnabled", advancedEffectsEnabled.ToString() },
});
#endif

if (m_isDisabledByPolicy != isDisabledByPolicy)
{
m_isDisabledByPolicy = isDisabledByPolicy;
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Controls/GroupCallActiveHeader.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Glyph="&#xE610;"
CheckedGlyph="&#xE720;"
IsOneWay="True"
Width="40"
Width="48"
Height="40" />

<controls:GlyphButton Click="Dismiss_Click"
Expand Down
6 changes: 3 additions & 3 deletions Telegram/Navigation/BootStrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ public virtual void OnInitialize(IActivatedEventArgs args)
/// because the asunc operations are in a single, global deferral created when the suspension
/// begins and completed automatically when the last viewmodel has been called (including this method).
/// </summary>
public virtual Task OnSuspendingAsync(object s, SuspendingEventArgs e, bool prelaunchActivated)
public virtual Task OnSuspendingAsync(object s, SuspendingEventArgs e)
{
Logger.Info($"Virtual {nameof(SuspendingEventArgs)}:{e.SuspendingOperation} {nameof(prelaunchActivated)}:{prelaunchActivated}");
Logger.Info($"Virtual {nameof(SuspendingEventArgs)}:{e.SuspendingOperation}");

return Task.CompletedTask;
}
Expand Down Expand Up @@ -702,7 +702,7 @@ private async void CallHandleSuspendingAsync(object sender, SuspendingEventArgs
//{
// await _LifecycleLogic.AutoSuspendAllFramesAsync(sender, e, AutoExtendExecutionSession);
//}
await OnSuspendingAsync(sender, e, PrelaunchActivated);
await OnSuspendingAsync(sender, e);
}
finally
{
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Services/SettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ public Vector2 Pencil
_pencil = new Vector2(offset, thickness);
}

return _pencil ?? new Vector2(1f, 0.22f);
return _pencil ?? new Vector2(0f, 0.33f);
}
set
{
Expand Down
2 changes: 1 addition & 1 deletion Telegram/ViewModels/DialogViewModel.Media.cs
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ private async Task<BaseObject> SendMessageAsync(Chat chat, long replyToMessageId
await ShowPopupAsync(Strings.MessageScheduledLimitReached, Strings.AppName, Strings.OK);
}
}
else if (options.SchedulingState != null && Type != DialogType.ScheduledMessages)
else if (options?.SchedulingState != null && Type != DialogType.ScheduledMessages)
{
NavigationService.NavigateToChat(chat, scheduled: true);
}
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Views/Popups/DeleteChatPopup.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public DeleteChatPopup(IClientService clientService, Chat chat, ChatList chatLis
var basicGroup = clientService.GetBasicGroup(chat);
var supergroup = clientService.GetSupergroup(chat);

var deleteAll = user?.Id != clientService.Options.MyId && chat.CanBeDeletedForAllUsers;
var deleteAll = user != null && user.Id != clientService.Options.MyId && chat.CanBeDeletedForAllUsers;
if (deleteAll)
{
CheckBox.Visibility = Visibility.Visible;
Expand Down

0 comments on commit 88447e6

Please sign in to comment.