1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-03-01 15:11:21 +01:00

fix(mobile): make user.memoryEnable optional (#3680)

* chore(server): avoid breaking changes

* generate api

* mobile app
This commit is contained in:
Alex 2023-08-14 12:52:06 -05:00 committed by GitHub
parent b1b215f083
commit 0d80ae3a91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 16 deletions

View file

@ -3159,7 +3159,7 @@ export interface UserResponseDto {
* @type {boolean} * @type {boolean}
* @memberof UserResponseDto * @memberof UserResponseDto
*/ */
'memoriesEnabled': boolean; 'memoriesEnabled'?: boolean;
/** /**
* *
* @type {string} * @type {string}

View file

@ -342,10 +342,11 @@ class HomePage extends HookConsumerWidget {
listener: selectionListener, listener: selectionListener,
selectionActive: selectionEnabledHook.value, selectionActive: selectionEnabledHook.value,
onRefresh: refreshAssets, onRefresh: refreshAssets,
topWidget: topWidget: (currentUser != null &&
(currentUser != null && currentUser.memoryEnabled) currentUser.memoryEnabled != null &&
? const MemoryLane() currentUser.memoryEnabled!)
: const SizedBox(), ? const MemoryLane()
: const SizedBox(),
), ),
error: (error, _) => Center(child: Text(error.toString())), error: (error, _) => Center(child: Text(error.toString())),
loading: buildLoadingIndicator, loading: buildLoadingIndicator,

View file

@ -44,7 +44,7 @@ class User {
bool isPartnerSharedWith; bool isPartnerSharedWith;
bool isAdmin; bool isAdmin;
String profileImagePath; String profileImagePath;
bool memoryEnabled; bool? memoryEnabled;
@Backlink(to: 'owner') @Backlink(to: 'owner')
final IsarLinks<Album> albums = IsarLinks<Album>(); final IsarLinks<Album> albums = IsarLinks<Album>();
@Backlink(to: 'sharedUsers') @Backlink(to: 'sharedUsers')

View file

@ -16,7 +16,7 @@ Name | Type | Description | Notes
**id** | **String** | | **id** | **String** | |
**isAdmin** | **bool** | | **isAdmin** | **bool** | |
**lastName** | **String** | | **lastName** | **String** | |
**memoriesEnabled** | **bool** | | **memoriesEnabled** | **bool** | | [optional]
**oauthId** | **String** | | **oauthId** | **String** | |
**profileImagePath** | **String** | | **profileImagePath** | **String** | |
**shouldChangePassword** | **bool** | | **shouldChangePassword** | **bool** | |

View file

@ -21,7 +21,7 @@ class UserResponseDto {
required this.id, required this.id,
required this.isAdmin, required this.isAdmin,
required this.lastName, required this.lastName,
required this.memoriesEnabled, this.memoriesEnabled,
required this.oauthId, required this.oauthId,
required this.profileImagePath, required this.profileImagePath,
required this.shouldChangePassword, required this.shouldChangePassword,
@ -45,7 +45,13 @@ class UserResponseDto {
String lastName; String lastName;
bool memoriesEnabled; ///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? memoriesEnabled;
String oauthId; String oauthId;
@ -85,7 +91,7 @@ class UserResponseDto {
(id.hashCode) + (id.hashCode) +
(isAdmin.hashCode) + (isAdmin.hashCode) +
(lastName.hashCode) + (lastName.hashCode) +
(memoriesEnabled.hashCode) + (memoriesEnabled == null ? 0 : memoriesEnabled!.hashCode) +
(oauthId.hashCode) + (oauthId.hashCode) +
(profileImagePath.hashCode) + (profileImagePath.hashCode) +
(shouldChangePassword.hashCode) + (shouldChangePassword.hashCode) +
@ -113,7 +119,11 @@ class UserResponseDto {
json[r'id'] = this.id; json[r'id'] = this.id;
json[r'isAdmin'] = this.isAdmin; json[r'isAdmin'] = this.isAdmin;
json[r'lastName'] = this.lastName; json[r'lastName'] = this.lastName;
if (this.memoriesEnabled != null) {
json[r'memoriesEnabled'] = this.memoriesEnabled; json[r'memoriesEnabled'] = this.memoriesEnabled;
} else {
// json[r'memoriesEnabled'] = null;
}
json[r'oauthId'] = this.oauthId; json[r'oauthId'] = this.oauthId;
json[r'profileImagePath'] = this.profileImagePath; json[r'profileImagePath'] = this.profileImagePath;
json[r'shouldChangePassword'] = this.shouldChangePassword; json[r'shouldChangePassword'] = this.shouldChangePassword;
@ -142,7 +152,7 @@ class UserResponseDto {
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
isAdmin: mapValueOfType<bool>(json, r'isAdmin')!, isAdmin: mapValueOfType<bool>(json, r'isAdmin')!,
lastName: mapValueOfType<String>(json, r'lastName')!, lastName: mapValueOfType<String>(json, r'lastName')!,
memoriesEnabled: mapValueOfType<bool>(json, r'memoriesEnabled')!, memoriesEnabled: mapValueOfType<bool>(json, r'memoriesEnabled'),
oauthId: mapValueOfType<String>(json, r'oauthId')!, oauthId: mapValueOfType<String>(json, r'oauthId')!,
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!, profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!, shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
@ -203,7 +213,6 @@ class UserResponseDto {
'id', 'id',
'isAdmin', 'isAdmin',
'lastName', 'lastName',
'memoriesEnabled',
'oauthId', 'oauthId',
'profileImagePath', 'profileImagePath',
'shouldChangePassword', 'shouldChangePassword',

View file

@ -7152,8 +7152,7 @@
"createdAt", "createdAt",
"deletedAt", "deletedAt",
"updatedAt", "updatedAt",
"oauthId", "oauthId"
"memoriesEnabled"
], ],
"type": "object" "type": "object"
}, },

View file

@ -14,7 +14,7 @@ export class UserResponseDto {
deletedAt!: Date | null; deletedAt!: Date | null;
updatedAt!: Date; updatedAt!: Date;
oauthId!: string; oauthId!: string;
memoriesEnabled!: boolean; memoriesEnabled?: boolean;
} }
export function mapUser(entity: UserEntity): UserResponseDto { export function mapUser(entity: UserEntity): UserResponseDto {

View file

@ -3159,7 +3159,7 @@ export interface UserResponseDto {
* @type {boolean} * @type {boolean}
* @memberof UserResponseDto * @memberof UserResponseDto
*/ */
'memoriesEnabled': boolean; 'memoriesEnabled'?: boolean;
/** /**
* *
* @type {string} * @type {string}