Figma 설명 프레임 반영 — 로그인·온보딩·스플래시 · HOME · GALAXY · 퀘스트·이클립스·알림
This commit is contained in:
@@ -26,13 +26,20 @@ class FirestoreGalaxyRepository implements GalaxyRepository {
|
||||
final user = userSnap.data() ?? const <String, dynamic>{};
|
||||
// 대표 팬덤(C-15). `primaryFandomId` 가 없던 계정은 옛 `fandomId` 를 쓴다.
|
||||
final myFandomId = user.strOr('primaryFandomId', user.strOr('fandomId'));
|
||||
// 「가입 또는 생성한 행성/성운」 — 최신 가입순. 시안 그리드가 세 칸이라 셋만 읽는다.
|
||||
// ponytail: 모아보기 리스트 그리드(명세 §2.58-2)를 붙이면 limit 과 페이지를 연다.
|
||||
// 「가입 또는 생성한 행성/성운」 — 최신 가입순 전부(Figma `540:19586`). 세 칸은 한 줄의 칸 수다.
|
||||
final membershipsF = db
|
||||
.collection('users/$uid/memberships')
|
||||
.orderBy('joinedAt', descending: true)
|
||||
.limit(3)
|
||||
.get();
|
||||
// 오늘(KST) 성운 생성 기록 — 서버 `dayKey`(UTC+9)와 같은 키.
|
||||
final kst = DateTime.now().toUtc().add(const Duration(hours: 9));
|
||||
final todayKey =
|
||||
'${kst.year.toString().padLeft(4, '0')}-${kst.month.toString().padLeft(2, '0')}-${kst.day.toString().padLeft(2, '0')}';
|
||||
// 규칙 배포 전이면 읽기가 거부된다 — 그때는 버튼을 막지 않고 서버 판정(E-FDM-02)에 맡긴다.
|
||||
final createdTodayF = db
|
||||
.doc('users/$uid/nebulaCreates/$todayKey')
|
||||
.get()
|
||||
.then((d) => d.exists, onError: (_) => false);
|
||||
|
||||
final fandomsF = db
|
||||
.collection('fandoms')
|
||||
@@ -102,6 +109,7 @@ class FirestoreGalaxyRepository implements GalaxyRepository {
|
||||
// Zap 은 가입·생성한 사용자에게만 보인다(Figma 「Zap 버튼」 규칙).
|
||||
joined: myFandomId.isNotEmpty,
|
||||
memberships: [for (final id in membershipIds) ?byId[id]],
|
||||
nebulaCreatedToday: await createdTodayF,
|
||||
joinedIds: {
|
||||
...?(user['fandomIds'] as List?)?.whereType<String>(),
|
||||
if (myFandomId.isNotEmpty) myFandomId,
|
||||
@@ -118,7 +126,8 @@ class FirestoreGalaxyRepository implements GalaxyRepository {
|
||||
if (q.isEmpty) return const [];
|
||||
final uid = _backend.requireUid;
|
||||
final db = _backend.db;
|
||||
final user = (await db.doc('users/$uid').get()).data() ?? const <String, dynamic>{};
|
||||
final user =
|
||||
(await db.doc('users/$uid').get()).data() ?? const <String, dynamic>{};
|
||||
final myFandomId = user.strOr('primaryFandomId', user.strOr('fandomId'));
|
||||
final names = await db
|
||||
.collection('fandomNames')
|
||||
@@ -130,7 +139,9 @@ class FirestoreGalaxyRepository implements GalaxyRepository {
|
||||
for (final d in names.docs)
|
||||
if (d.data()['fandomId'] case final String id when id.isNotEmpty) id,
|
||||
};
|
||||
final docs = await Future.wait([for (final id in ids) db.doc('fandoms/$id').get()]);
|
||||
final docs = await Future.wait([
|
||||
for (final id in ids) db.doc('fandoms/$id').get(),
|
||||
]);
|
||||
return [
|
||||
for (final doc in docs)
|
||||
if (doc.data() case final data?)
|
||||
@@ -152,7 +163,9 @@ class FirestoreGalaxyRepository implements GalaxyRepository {
|
||||
_ => null,
|
||||
},
|
||||
colorKey: data['colorKey'] is String ? data['colorKey'] as String : null,
|
||||
planetType: data['planetType'] is String ? data['planetType'] as String : null,
|
||||
planetType: data['planetType'] is String
|
||||
? data['planetType'] as String
|
||||
: null,
|
||||
name: data.strOr('name', id),
|
||||
rank: rank,
|
||||
fpi: data.intOr('fpiScore'),
|
||||
|
||||
Reference in New Issue
Block a user