Skip to content

Commit

Permalink
Re-enable to force users to login (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsreichardt authored Oct 16, 2024
1 parent 4fd3a6e commit 3440264
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions lib/src/providers/generate_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ import 'package:ankigpt/src/models/user_id.dart';
import 'package:ankigpt/src/providers/analytics_provider.dart';
import 'package:ankigpt/src/providers/clear_session_state_provider.dart';
import 'package:ankigpt/src/providers/current_usage_provider.dart';
import 'package:ankigpt/src/providers/has_account_provider.dart';
import 'package:ankigpt/src/providers/has_plus_provider.dart';
import 'package:ankigpt/src/providers/input_text_field_controller.dart';
import 'package:ankigpt/src/providers/logger/logger_provider.dart';
import 'package:ankigpt/src/providers/options_provider.dart';
import 'package:ankigpt/src/providers/router_provider.dart';
import 'package:ankigpt/src/providers/session_repository_provider.dart';
import 'package:ankigpt/src/providers/user_repository_provider.dart';
import 'package:ankigpt/src/providers/wants_to_generate_provider.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:cloud_functions/cloud_functions.dart';
import 'package:file_picker/file_picker.dart';
Expand Down Expand Up @@ -78,11 +80,11 @@ class GenerateNotifier extends _$GenerateNotifier {
_throwIfGpt4LimitReached(options.size, options.model);

// This code requires the user to have an account (anonymous doesn't count).
// if (!ref.read(hasAccount2Provider)) {
// ref.read(wantsToGenerateProvider.notifier).set(true);
// ref.read(routerProvider).go('/account');
// return;
// }
if (!ref.read(hasAccount2Provider)) {
ref.read(wantsToGenerateProvider.notifier).set(true);
ref.read(routerProvider).go('/account');
return;
}

state = const GenerateState.loading();

Expand Down
2 changes: 1 addition & 1 deletion lib/src/providers/generate_provider.g.dart

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

0 comments on commit 3440264

Please sign in to comment.