Compare commits

...

1 Commits

Author SHA1 Message Date
a17a21b12c save on logout & logout on close 2024-06-13 21:43:15 +02:00
3 changed files with 9 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ public interface IDataProvider
// General
abstract bool IsInitialized();
abstract void SetInitialized();
abstract bool SaveDatabase();
// Model
abstract T? Create<T>() where T : class, IOwnCharObject;

View File

@@ -49,6 +49,8 @@ public class DefaultDataManager : IDataManager
public bool Logout(UserAccount? account)
{
if (account != null && account.HasPermission(UserType.User))
DataProvider.SaveDatabase();
return true;
}

View File

@@ -256,4 +256,10 @@ public class JsonFileDataProvider : IDataProvider
}
return false;
}
public bool SaveDatabase()
{
SaveFile();
return true;
}
}