Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
> Fix creating file with releases at first application start
Browse files Browse the repository at this point in the history
  • Loading branch information
trueromanus committed Oct 3, 2020
1 parent 27e6228 commit fe44252
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Anilibria/Anilibria.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<PackageCertificateKeyFile>Anilibria_StoreKey.pfx</PackageCertificateKeyFile>
<GenerateAppInstallerFile>True</GenerateAppInstallerFile>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
Expand Down
2 changes: 1 addition & 1 deletion src/Anilibria/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" IgnorableNamespaces="uap mp uap3">
<Identity Name="53309GeekIT.AniLibria" Publisher="CN=41F76773-5EA9-45BD-A6E3-C759BF2C7A1E" Version="1.0.14.0" />
<Identity Name="53309GeekIT.AniLibria" Publisher="CN=41F76773-5EA9-45BD-A6E3-C759BF2C7A1E" Version="1.0.15.0" />
<mp:PhoneIdentity PhoneProductId="0c6438d5-8b6d-42d3-b652-e94c857552e4" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>AniLibria</DisplayName>
Expand Down
7 changes: 5 additions & 2 deletions src/Anilibria/Services/Implementations/ReleasesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ public class ReleasesService : IReleasesService {
public async Task LoadReleases () {
var releasesFile = await ApplicationData.Current.LocalFolder.TryGetItemAsync ( m_FileName );

if ( releasesFile == null ) return;
if ( releasesFile == null ) {
await ApplicationData.Current.LocalFolder.CreateFileAsync ( m_FileName , CreationCollisionOption.ReplaceExisting );
releasesFile = await ApplicationData.Current.LocalFolder.TryGetItemAsync ( m_FileName );
}

var relasesJson = await FileIO.ReadTextAsync ( (IStorageFile) releasesFile );
m_Releases = JsonConvert.DeserializeObject<List<ReleaseEntity>> ( relasesJson );
m_Releases = JsonConvert.DeserializeObject<List<ReleaseEntity>> ( relasesJson ) ?? Enumerable.Empty<ReleaseEntity>().ToList();
}

public async Task SaveReleases () {
Expand Down

0 comments on commit fe44252

Please sign in to comment.