diff --git a/.gitea/workflows/test-flight-cd.yaml b/.gitea/workflows/test-flight-cd.yaml
index 4320ecc5..c1244bd9 100644
--- a/.gitea/workflows/test-flight-cd.yaml
+++ b/.gitea/workflows/test-flight-cd.yaml
@@ -11,6 +11,30 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
+ - name: Checkout env repository
+ uses: actions/checkout@v2
+ with:
+ repository: mso7nueh/eatvio_app_env
+ path: env_repo
+ token: ${{ vars.MSO7NUEH_TOKEN }}
+ ref: main
+
+ - name: Copy .env file
+ run: |
+ mkdir -p env
+ cp env_repo/.env env/.env
+
+ - name: Load environment variables from .env
+ run: |
+ set -a
+ source env/.env
+ set +a
+ # Export all variables to GITHUB_ENV
+ while IFS= read -r line; do
+ if [[ $line =~ ^[A-Za-z_][A-Za-z0-9_]*= ]]; then
+ echo "$line" >> $GITHUB_ENV
+ fi
+ done < env/.env
- name: Unlock login keychain
run: |
@@ -36,4 +60,4 @@ jobs:
MATCH_GIT_URL: http://gitea.office.local:3000/mso7nueh/fastlane
FASTLANE_USER: eatvio2023@icloud.com
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ vars.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
- API_APPSTORE_KEY: ${{ vars.API_APPSTORE_KEY }}
\ No newline at end of file
+ API_APPSTORE_KEY: ${{ vars.API_APPSTORE_KEY }}
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 6388d648..14890f55 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -396,7 +396,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 65;
+ CURRENT_PROJECT_VERSION = 66;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -546,7 +546,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 65;
+ CURRENT_PROJECT_VERSION = 66;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -584,7 +584,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 65;
+ CURRENT_PROJECT_VERSION = 66;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 9a16914c..24c51e81 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -21,7 +21,7 @@
CFBundleSignature
????
CFBundleVersion
- 65
+ 66
ITSAppUsesNonExemptEncryption
LSRequiresIPhoneOS
diff --git a/lib/features/diary/presentation/bloc/diary_cubit.dart b/lib/features/diary/presentation/bloc/diary_cubit.dart
index 1bbfbbc7..6e6f8891 100644
--- a/lib/features/diary/presentation/bloc/diary_cubit.dart
+++ b/lib/features/diary/presentation/bloc/diary_cubit.dart
@@ -136,15 +136,7 @@ class DiaryCubit extends Cubit {
final fifthMeal = MealModel(id: 0, time: '0', typeNumber: 5, satiety: 0, mood: 0, portions: fifthMealPortions ?? [], photos: []);
emit(
DiaryState.loadedTomorrowWithDiet(
- diary: diaryDay.copyWith(
- meals: [
- firstMeal,
- secondMeal,
- thirdMeal,
- fourthMeal,
- fifthMeal,
- ],
- ),
+ diary: diaryDay.copyWith(meals: [firstMeal, secondMeal, thirdMeal, fourthMeal, fifthMeal]),
selectedDay: selectedDay,
selectedMeal: selectedMeal,
),
@@ -156,7 +148,7 @@ class DiaryCubit extends Cubit {
Future fetchDiary([bool needLoading = false, int? diaryId, int? currentDay]) async {
this.diaryId ??= diaryId;
-
+ final isConsultantView = this.diaryId != null;
if (needLoading) {
emit(const DiaryState.loading());
selectedMeal = 1;
@@ -180,7 +172,8 @@ class DiaryCubit extends Cubit {
String? planName;
if (diaryDay.chosenPlanId != null) {
final chosenPlanModel = await chatRepository.getChosenPlan(id: diaryDay.chosenPlanId!);
- if (diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayCommented || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented) {
+ if (!isConsultantView &&
+ (diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayCommented || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented)) {
await diaryRepository.viewCommentOfDiaryDayByConsultant(diaryId: diaryDay.id);
}
consultantReview = await diaryRepository.getDiaryComments(planId: diaryDay.chosenPlanId!, diaryId: diaryDay.id);
@@ -192,24 +185,26 @@ class DiaryCubit extends Cubit {
final isDiaryFinished = diaryDay.typeOfDiary.diaryState == DiaryStateEnum.finished || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayFinished;
- final isDiaryCommented = diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented ||
+ final isDiaryCommented =
+ diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented ||
diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayCommented ||
diaryDay.typeOfDiary.diaryState == DiaryStateEnum.reviewedByUser;
emit(
DiaryState.loaded(
- diary: diaryDay,
- nutrition: nutrition,
- selectedDay: selectedDay,
- selectedMeal: selectedMeal,
- isConsultantView: this.diaryId != null,
- consultantReview: consultantReview,
- isDiaryFinished: isDiaryFinished,
- isDiaryCommented: isDiaryCommented,
- chosenPlanCurrentDay: currentPlanDay,
- chosenPlanDuration: planDuration,
- chosenPlanName: planName,
- isMoodEnabled: isMoodEnabled,
- isWakeUpAndRetireEnabled: isWakeUpAndRetireTimeEnabled),
+ diary: diaryDay,
+ nutrition: nutrition,
+ selectedDay: selectedDay,
+ selectedMeal: selectedMeal,
+ isConsultantView: isConsultantView,
+ consultantReview: consultantReview,
+ isDiaryFinished: isDiaryFinished,
+ isDiaryCommented: isDiaryCommented,
+ chosenPlanCurrentDay: currentPlanDay,
+ chosenPlanDuration: planDuration,
+ chosenPlanName: planName,
+ isMoodEnabled: isMoodEnabled,
+ isWakeUpAndRetireEnabled: isWakeUpAndRetireTimeEnabled,
+ ),
);
} catch (e, st) {
log(e.toString(), stackTrace: st);
@@ -217,17 +212,8 @@ class DiaryCubit extends Cubit {
}
}
- Future finishDiaryDay({
- required int diaryId,
- required String wakeUp,
- required String retire,
- }) async {
- await diaryRepository.finishDiaryDay(
- diaryId: diaryId,
- wakeUp: wakeUp,
- retire: retire,
- comment: comment.isEmpty ? null : comment,
- );
+ Future finishDiaryDay({required int diaryId, required String wakeUp, required String retire}) async {
+ await diaryRepository.finishDiaryDay(diaryId: diaryId, wakeUp: wakeUp, retire: retire, comment: comment.isEmpty ? null : comment);
await fetchDiary();
}