Skip to content

Commit aa1f3c8

Browse files
authored
v1.6.44 (#263)
* fix - discord authentication (#199) * Flyout menu - reduce number of taps to sign in * App Shell - Make sure we fetch user data first then bind that data * Flyout - Fix Logout button * Arch - fetching data | setup a singleton to handle fetching structure and bind it to App Shell * Shell - Manage logout within the new mechanism * cleanup - Pages/views * Code base - Org | Organise the weak reference messages classes * News Page -| Setup singleton * Articlepage cleanup * About Page -| set as a singleton * Feeds page -| call as a singleton * Bookmarks - as for all give the singleton treatment * App Shell - remove OpenAuth reference * Android native - BakcPress | remove nullable reference types * fix: Custom feed not loading after navigating from an article (#202) * Fix - Feeds VM | make sure to manage `IsBusy` properly inside `UpdateFeeds()` * cleanup - Feed VM | Forgot to remove the previous setter of `IsBusy` * IOS properties - change Debug linker behaviour (#204) * BETA - Fix: crash sometimes experience on Launch (#205) * MCT - Regester TouchBehavior as a singleton * App.cs - Remove start DB on resume * Ressources - font references | fix the SemiBold reference (#206) * SQLite - update initialisation (#207) * fix: sqlite lockcrash (#208) * SQLite - update initialisation * SqLite - make sure we close the connection after we create the tables * Add sentry breadcrumbs to db creation process (#209) * SQLite - update initialisation * SqLite - make sure we close the connection after we create the tables * App - CreateWindow | add sentry breadcrumbs * imp: optimisation of local storage (#211) * SQLite - update initialisation * SqLite - make sure we close the connection after we create the tables * App - CreateWindow | add sentry breadcrumbs * Local Storage - SQLite | Create a class to genera DB actions * Local storage - general database | fix typo * Local storage - general sqlite DB | Implement the service accross the board * Feed - fix feed search * MainProg - DI | improve org of db singleton registration * Local storage - backup | create a service * fuck me sideways.... * Article Preview - share button | be more specific on the source (#213) * Fetcher - Sources | Utilise a static reference as Sources, as we only really set it once but need it all the time everywhere (#214) * Fix: bookmark status (#216) * Main feed - bookmark | fix the issue of the bookmark status not showing * Local storage - get bookmark | make sure that bookmarks are marked as IsSaved automatically * Local storage - main db | remove unecessary listing of artilces * Bookmark - db | Make sure the status is correctly set * feeds - view model | remove unused references (#217) * Fix: feed bookmark issue (#218) * article - bookmark | make sure to return the rescently added first * Fetcher - bookmarks | improve performance by caching all the bookmarks (as much as possible * Bookmark - caching | loas the bookmarks first thing * Fix: bookmark status not updating on main feed (#219) * Main feed - bookmark status | change the way we reload the article when receiving the bookmark message * Article Model - Change bookmark update * Hotfix: on start exception (#220) * App | Remove StartDb() * Change the way we update Sources * Fetcher.Sources | prevent nullable excepttions * fix: Fetcher - UpdateBackupSources | improve Error handling (#221) * App | Remove StartDb() * Change the way we update Sources * Fetcher.Sources | prevent nullable excepttions * Fetcher - UpdateBackupSources | improve Error handling * cleanup: stuff I forgot (#224) * xaml stuff * remove unused style declaration * Main Feed - Refresh DB | Make the try catch actually useful * Feat: notification setup (#225) * Add google services stuff to git ignore * Include google services files * deps | setup thomasgalliker's `Plugin.FirebasePushNotifications` * Update push notification setup * Apple Manifset - enable remote background thinggy * CI | use environment variable for package id * display packagename * CI/CD - iOS | install GoogleService-Info * CD - android | add secrets * d * CD - android | install google-services.json * prebuild - iOS | fix service tokens * Ci/CD - file google services installations * oops * d * Ci - update all * Notification - android | set the icon * for now let's just `hardcode` packagename (#226) * fix: android pre-build - fix environment variables (#228) * CD - android pre-build | fix environment variables * update xcode version * fix: pipelines xcode version (#229) * pipelines - dev | upgrade xcode * pipelines - prod | upgrade xcode * fix: notification setup (#230) * Ci - Adnroid | Check google services token * Prebuild - android | set the package name from the worflow * push notification - ios | fix setup * deps | Bump Plugin.FirebasePushNotifications to prerelease * Notiffication setup - Android | improve logging * fix: change the approach of Google Services credentials (#231) * CD - android | get google service token * forgot google_services_json * cd - android | Generate and import Google Services in their respective steps * CD - Android | change the way we generate google services * CD - iOS | generate google services * CI - main workflow | forgot google services PLIST * pre-build - android | remove unnecessary stuff * CI/CD - all | Remove redundant references of google services properties * CD - iOS | fix typo * same * workflow | update prod * s * fix - dev pipeline * dev deploy | remove * feat: notifications implement channels (#232) * Notifications - android | add channels * Notifications - Android | List channels * deps | downgrade `Plugin.FirebasePushNotifications` * workflow - android | set `changesNotSentForReview: true` * feat: notification navigation (#233) * Android - setup | enable `SingleTask` Launch Mode * Article - notification | handle navigation to the article * Notification - OnNotificationOpened | convert `articleId` to string * fix crash on notification nav * Article - notification | handle loading indicator better * Android - notification | improve permission request * Article - Notification | add option to handle action * cd-android.yml | unset changesNotSentForReview * Feat: notifications settings (#235) * Android - Notification | add `PostNotification` permission to the manifest * Notification Request | make it makes sense * Shell | add a totally empty settings page * Setting page | design * Settings page - open notification settings * notif - fix| OnNotificationOpened + OnNotificationAction -> escape null inputs (#238) * Hotfix: crash notification (#239) * notif - fix| OnNotificationOpened + OnNotificationAction -> escape null inputs * Notification - OnNotificationOpened | check `articleId` key exist * Notification - OnNotificationOpened | documentation * I'm a bit of an idiot * feat: deals page (#237) * Shell - Views | create and bind deals page * Styles - Add discount color * Deals page - Display deals * Article page - deals | change discount colour * Article page - deals | change size of the discount mark * SQLite - general DB | store deals * Deal Page | create a badge * General Storage | Complete `UpdateDeals` * Cleanp up | Article comparer * Deal page - Add loading indicator * Deal page -| reorder deals * feat: settings - deals (#242) * Settings - deal | enable/disable deal page * Settings - Deals | enable/disable deals on article page * Settings - vm | create a general method to handle updates * feat: add notif badges (#243) * fix: deals loadstuck (#244) * Deals page - fix | update deal `OnAppearing` * Deals page | order by expiring deals * random cleaup * hotfix: crash on notification opening (#246) * Article page - view Model | prevetn `System.ArgumentNullException` on deals * Article page - ViewModel | handle deals process exceptions * ArticleViewModel - constructor | check `Deals` before treating it * iOS - Tab badge | fix out of range issue (#248) * fix: News Feed doesn't reset when pressing its tab (#251) * AndroidShellRenderer - handler | declare it using genereci overload * Fix - android main feed reset | merge AndroidShellRenderer with TabbarBadgeRenderer * feat: dynamic time update (#253) * Converter - Time Span | reformat and clean up * Main feed - vm | create a method to refresh the timespan of the articles * Main Feed - On Resume | enhance the on resume behaviour * News page - update navigation stuff on resume * news page - view model | * Fetcher - ArticleExist | make sure to check for Bookmarks being null (#256) * fix: ios - UI settings tweaks (#257) * Settings Page - UI | Change title * Settings page - UI | tweak notification settings label * Settings page - view | format code * settings page - UI | improve the toggles * Settings page - UI | improve toggle colours * fix: DealPageSett (#258) * Settings Page - UI | Change title * Settings page - UI | tweak notification settings label * Settings page - view | format code * settings page - UI | improve the toggles * Settings page - UI | improve toggle colours * fix: DealPageSett * feat: display source image (#261) * UI - Article Preview | display the logo of the source if available * UI - Article Page | Add source image or badge as title closes #249 * fix: ios badge thread issue (#264) * ios - tab badge | run that on the main thread * ios - tab badge | UpdateBadge() error handling * fix: no internet connection handler (#265) Resolves #262 * fetcher - error handler | prevent internet connection related error from being reported * fcm - offline | notification setup disable if device offline * Fetcher - HTTP error handler | move the internet connection check at the top
1 parent 6965c05 commit aa1f3c8

File tree

8 files changed

+97
-22
lines changed

8 files changed

+97
-22
lines changed

App/Controls/ArticlePreview.xaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,23 @@
8989
HeightRequest="25"
9090
Padding="4,0"
9191
BackgroundColor="{Binding Article.Source.PrimaryColour, Mode=OneWay, Source={x:Reference preview}}">
92-
<Label FontSize="13"
92+
<Grid>
93+
<Label FontSize="13"
9394
HorizontalOptions="Center"
9495
VerticalOptions="Center"
9596
Text="{Binding Article.Source.Name, Mode=OneWay, Source={x:Reference preview}}"
9697
FontFamily="P-Bold"
98+
IsVisible="{Binding Article.Source.Logo, Converter={StaticResource NullOrEmptyStringConverter}, Source={x:Reference preview}}"
9799
TextColor="{Binding Article.Source.SecondaryColour, Mode=OneWay, Source={x:Reference preview}}"
98-
/>
100+
101+
>
102+
</Label>
103+
<Image HorizontalOptions="Fill"
104+
MaximumWidthRequest="90"
105+
MaximumHeightRequest="25"
106+
Source="{Binding Article.Source.Logo, Source={x:Reference preview}}"/>
107+
108+
</Grid>
99109
</Border>
100110

101111
<!-- Share and save-->
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Globalization;
2+
3+
namespace GamHubApp.Helpers;
4+
5+
class NullOrEmptyStringConverter : IValueConverter
6+
{
7+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
8+
{
9+
if (value is string val)
10+
{
11+
return string.IsNullOrEmpty(val);
12+
}
13+
return true;
14+
}
15+
16+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
17+
{
18+
throw new NotImplementedException();
19+
}
20+
}

App/Models/Source.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class Source
2121
public string SecondaryColour { get; set; }
2222
[JsonProperty("domain")]
2323
public string Domain { get; set; }
24+
[JsonProperty("logo")]
25+
public string Logo { get; set; }
2426
[JsonProperty("isActive")]
2527
public bool IsActive { get; set; }
2628
[OneToMany(CascadeOperations = CascadeOperation.All)]

App/Platforms/iOS/Renderers/TabbarBadgeRenderer.cs

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Microsoft.Maui.Controls.Handlers.Compatibility;
33
using Microsoft.Maui.Controls.Platform.Compatibility;
44
using Microsoft.Maui.Platform;
5+
using Sentry;
56
using System.Diagnostics;
67
using UIKit;
78

@@ -41,17 +42,31 @@ private void OnCountChanged(object? sender, int newCount)
4142
}
4243
private void UpdateBadge(int count)
4344
{
44-
if (_cartTabbarItem is not null)
45+
try
4546
{
46-
if (count <= 0)
47+
MainThread.BeginInvokeOnMainThread(() =>
4748
{
48-
_cartTabbarItem.BadgeValue = null;
49-
}
50-
else
51-
{
52-
_cartTabbarItem.BadgeValue = count.ToString();
53-
_cartTabbarItem.BadgeColor = (App.Current.Resources["DiscountColor"] as Color).ToPlatform();
54-
}
49+
if (_cartTabbarItem is not null)
50+
{
51+
if (count <= 0)
52+
{
53+
_cartTabbarItem.BadgeValue = null;
54+
}
55+
else
56+
{
57+
_cartTabbarItem.BadgeValue = count.ToString();
58+
_cartTabbarItem.BadgeColor = (App.Current.Resources["DiscountColor"] as Color).ToPlatform();
59+
}
60+
}
61+
});
62+
}
63+
catch (Exception ex)
64+
{
65+
#if DEBUG
66+
Debug.WriteLine(ex);
67+
#else
68+
SentrySdk.CaptureException(ex);
69+
#endif
5570
}
5671
}
5772
protected override void Dispose(bool disposing)

App/Resources/Styles/Styles.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<helpers:ZeroToFalseConverter x:Key="ZeroToFalseConverter"/>
2020
<helpers:ZeroToTrueConverter x:Key="ZeroToTrueConverter"/>
2121
<helpers:NotNullOrEmptyStringConverter x:Key="NotNullOrEmptyStringConverter"/>
22+
<helpers:NullOrEmptyStringConverter x:Key="NullOrEmptyStringConverter"/>
2223

2324
<ResourceDictionary>
2425
<OnPlatform x:Key="TitleRightMargin" x:TypeArguments="x:Double">

App/Services/Fetcher.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public async Task<Collection<Source>> GetSources()
8383
{
8484
return Fetcher.Sources = await WebService.Get<Collection<Source>>(controller: "sources",
8585
action: "getAll",
86-
unSuccessCallback: e => _ = HandleHttpException(e));
86+
unSuccessCallback: e => _ = HandleHttpException(e));
8787
}
8888
/// <summary>
8989
/// Get the feed of an article
@@ -429,10 +429,16 @@ public void SaveUserInfo(User user)
429429
/// <exception cref="Exception"></exception>
430430
private async Task HandleHttpException(HttpResponseMessage err)
431431
{
432+
string errMsg = await err.Content.ReadAsStringAsync();
433+
434+
if (Connectivity.Current.NetworkAccess != NetworkAccess.Internet
435+
&& (errMsg.Contains("internet connection") || errMsg.Contains("Connection failure")))
436+
// If the error is being thrown because there is no internet: there is no point reporting it
437+
return;
432438
#if DEBUG
433-
throw new Exception(await err.Content.ReadAsStringAsync());
439+
throw new Exception(errMsg);
434440
#else
435-
SentrySdk.CaptureException(new Exception(await err.Content.ReadAsStringAsync()));
441+
SentrySdk.CaptureException(new Exception(errMsg));
436442
#endif
437443
}
438444

App/ViewModels/AppShellViewModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public async Task UpdateDeals()
127127
/// </summary>
128128
public async Task NotificationSetup()
129129
{
130+
if (Connectivity.Current.NetworkAccess != NetworkAccess.Internet)
131+
return;
132+
130133
if ((await _firebasePushPermissions.GetAuthorizationStatusAsync() is not Plugin.FirebasePushNotifications.Model.AuthorizationStatus.Granted)
131134
&& Preferences.Get(_notificationKey, true))
132135
#if ANDROID

App/Views/ArticlePage.xaml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,32 @@
1616
<Shell.TitleView>
1717
<ContentView Margin="0,0,0,0" >
1818
<Grid ColumnDefinitions="4*,*">
19-
20-
<Label Text="{Binding SelectedArticle.Source.Name}"
21-
VerticalOptions="Center"
22-
HorizontalOptions="Center"
23-
FontSize="20"
24-
TextColor="{StaticResource FontColor}"
25-
FontFamily="P-Bold"
26-
Grid.Column="0" />
19+
20+
<Border Grid.Column="0"
21+
Grid.Row="0"
22+
HorizontalOptions="Center"
23+
VerticalOptions="Center"
24+
StrokeShape="RoundRectangle 8"
25+
HeightRequest="35"
26+
Padding="4,0"
27+
BackgroundColor="{Binding SelectedArticle.Source.PrimaryColour, Mode=OneWay}">
28+
<Grid>
29+
<Label FontSize="13"
30+
HorizontalOptions="Center"
31+
VerticalOptions="Center"
32+
Text="{Binding SelectedArticle.Source.Name, Mode=OneWay}"
33+
FontFamily="P-Bold"
34+
IsVisible="{Binding SelectedArticle.Source.Logo, Converter={StaticResource NullOrEmptyStringConverter}}"
35+
TextColor="{Binding SelectedArticle.Source.SecondaryColour, Mode=OneWay}"
36+
>
37+
</Label>
38+
<Image HorizontalOptions="Fill"
39+
MaximumWidthRequest="120"
40+
MaximumHeightRequest="35"
41+
Source="{Binding SelectedArticle.Source.Logo}"/>
42+
43+
</Grid>
44+
</Border>
2745

2846

2947
<!-- Sub Menu button -->

0 commit comments

Comments
 (0)