refactor(mobile): remove int user id (#16814)

* refactor: user entity

* chore: rebase fixes

* refactor: remove int user Id

* refactor: migrate store userId from int to string

* refactor: rename uid to id

* fix: migration

* pr feedback

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2025-03-18 21:35:37 +05:30
committed by GitHub
parent e96ffd43e7
commit 9cf3b88f80
38 changed files with 182 additions and 157 deletions
@@ -26,7 +26,7 @@ class AlbumAdditionalSharedUserSelectionPage extends HookConsumerWidget {
final sharedUsersList = useState<Set<UserDto>>({});
addNewUsersHandler() {
context.maybePop(sharedUsersList.value.map((e) => e.uid).toList());
context.maybePop(sharedUsersList.value.map((e) => e.id).toList());
}
buildTileIcon(UserDto user) {
@@ -151,7 +151,7 @@ class AlbumAdditionalSharedUserSelectionPage extends HookConsumerWidget {
onData: (users) {
for (var sharedUsers in album.sharedUsers) {
users.removeWhere(
(u) => u.uid == sharedUsers.id || u.uid == album.ownerId,
(u) => u.id == sharedUsers.id || u.id == album.ownerId,
);
}
@@ -85,7 +85,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
void handleUserClick(UserDto user) {
var actions = [];
if (user.uid == userId) {
if (user.id == userId) {
actions = [
ListTile(
leading: const Icon(Icons.exit_to_app_rounded),
@@ -170,10 +170,10 @@ class AlbumOptionsPage extends HookConsumerWidget {
color: context.colorScheme.onSurfaceSecondary,
),
),
trailing: userId == user.uid || isOwner
trailing: userId == user.id || isOwner
? const Icon(Icons.more_horiz_rounded)
: const SizedBox(),
onTap: userId == user.uid || isOwner
onTap: userId == user.id || isOwner
? () => handleUserClick(user)
: null,
);
+1 -1
View File
@@ -33,7 +33,7 @@ class AlbumsPage extends HookConsumerWidget {
final searchController = useTextEditingController();
final debounceTimer = useRef<Timer?>(null);
final filterMode = useState(QuickFilterMode.all);
final userId = ref.watch(currentUserProvider)?.uid;
final userId = ref.watch(currentUserProvider)?.id;
final searchFocusNode = useFocusNode();
toggleViewMode() {
+1 -1
View File
@@ -72,7 +72,7 @@ class ActivitiesPage extends HookConsumerWidget {
final activity = data[index];
final canDelete = activity.user.id == user?.id ||
album.ownerId == user?.uid;
album.ownerId == user?.id;
return Padding(
padding: const EdgeInsets.all(5),