From 0d80ae3a91b09d66a837ed58b160e2193baeaa98 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 14 Aug 2023 12:52:06 -0500 Subject: [PATCH] fix(mobile): make user.memoryEnable optional (#3680) * chore(server): avoid breaking changes * generate api * mobile app --- cli/src/api/open-api/api.ts | 2 +- mobile/lib/modules/home/views/home_page.dart | 9 +++++---- mobile/lib/shared/models/user.dart | 2 +- mobile/openapi/doc/UserResponseDto.md | Bin 902 -> 913 bytes .../openapi/lib/model/user_response_dto.dart | Bin 6765 -> 7213 bytes server/immich-openapi-specs.json | 3 +-- .../user/response-dto/user-response.dto.ts | 2 +- web/src/api/open-api/api.ts | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cli/src/api/open-api/api.ts b/cli/src/api/open-api/api.ts index 9cedbdf2c4..e8662175a4 100644 --- a/cli/src/api/open-api/api.ts +++ b/cli/src/api/open-api/api.ts @@ -3159,7 +3159,7 @@ export interface UserResponseDto { * @type {boolean} * @memberof UserResponseDto */ - 'memoriesEnabled': boolean; + 'memoriesEnabled'?: boolean; /** * * @type {string} diff --git a/mobile/lib/modules/home/views/home_page.dart b/mobile/lib/modules/home/views/home_page.dart index a628df9bd0..c3226f228e 100644 --- a/mobile/lib/modules/home/views/home_page.dart +++ b/mobile/lib/modules/home/views/home_page.dart @@ -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, diff --git a/mobile/lib/shared/models/user.dart b/mobile/lib/shared/models/user.dart index 3041500641..df742a1541 100644 --- a/mobile/lib/shared/models/user.dart +++ b/mobile/lib/shared/models/user.dart @@ -44,7 +44,7 @@ class User { bool isPartnerSharedWith; bool isAdmin; String profileImagePath; - bool memoryEnabled; + bool? memoryEnabled; @Backlink(to: 'owner') final IsarLinks albums = IsarLinks(); @Backlink(to: 'sharedUsers') diff --git a/mobile/openapi/doc/UserResponseDto.md b/mobile/openapi/doc/UserResponseDto.md index 6455c12d0378a00a6facb8fefdabd3f9224eebad..b6e42b33e1bf0321261c5cb71a0e57e6d045b6de 100644 GIT binary patch delta 23 ecmZo;pUA#Jl8Gxizn~;DKQA#ScC!Ri9wPu)>IYQ- delta 26 hcmbQp-p0N`l8KW`ODjLIv?RlG@Bj*uk;k4QO@I#98c%#+l>wNO66h6FPuUj)KuR%nGlNLs?VCX=J#q%!6N z22KHs=h7l!GA6WQBh;v%G>etA{pL@Eb_bz;poF4MAsLaPh*{!GzR_{yGWgn|C$X^z zn3V9CKZezL@SM%?of&pErLObx{PT0IjNlZ3alX*~k-#PY=f&cJ^SiYxE$=TUFN*cF zmc#75oK*HO7!>z0#3A~a&_qXq%!SHJ=GrL`VsqBjYt(?^Tr9flhZ{sm7*U!?E a+IG5L-%9UmJK1IZqmmtMyjIiF?)VEAKA~Lz delta 75 zcmV-R0JQ(DIPEmBUILRR0uGbL4iB?(0#E@2VsCG3vm^y}1e4MU60^$*u>_N(4mYzG h5Ap;7A+re-xd#tzWo>VAX=QUoZee0