Skip to content

Commit

Permalink
fix(mobile): make user.memoryEnable optional (immich-app#3680)
Browse files Browse the repository at this point in the history
* chore(server): avoid breaking changes

* generate api

* mobile app
  • Loading branch information
alextran1502 authored Aug 14, 2023
1 parent b1b215f commit 0d80ae3
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cli/src/api/open-api/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions mobile/lib/modules/home/views/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,11 @@ class HomePage extends HookConsumerWidget {
listener: selectionListener,
selectionActive: selectionEnabledHook.value,
onRefresh: refreshAssets,
topWidget:
(currentUser != null && currentUser.memoryEnabled)
? const MemoryLane()
: const SizedBox(),
topWidget: (currentUser != null &&
currentUser.memoryEnabled != null &&
currentUser.memoryEnabled!)
? const MemoryLane()
: const SizedBox(),
),
error: (error, _) => Center(child: Text(error.toString())),
loading: buildLoadingIndicator,
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/shared/models/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class User {
bool isPartnerSharedWith;
bool isAdmin;
String profileImagePath;
bool memoryEnabled;
bool? memoryEnabled;
@Backlink(to: 'owner')
final IsarLinks<Album> albums = IsarLinks<Album>();
@Backlink(to: 'sharedUsers')
Expand Down
2 changes: 1 addition & 1 deletion mobile/openapi/doc/UserResponseDto.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 14 additions & 5 deletions mobile/openapi/lib/model/user_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions server/immich-openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7152,8 +7152,7 @@
"createdAt",
"deletedAt",
"updatedAt",
"oauthId",
"memoriesEnabled"
"oauthId"
],
"type": "object"
},
Expand Down
2 changes: 1 addition & 1 deletion server/src/domain/user/response-dto/user-response.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class UserResponseDto {
deletedAt!: Date | null;
updatedAt!: Date;
oauthId!: string;
memoriesEnabled!: boolean;
memoriesEnabled?: boolean;
}

export function mapUser(entity: UserEntity): UserResponseDto {
Expand Down
2 changes: 1 addition & 1 deletion web/src/api/open-api/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0d80ae3

Please sign in to comment.