Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/lib/pages/onboarding/wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ class _OnboardingWrapperState extends State<OnboardingWrapper> with TickerProvid
userId: SharedPreferencesUtil().uid,
);
if (SharedPreferencesUtil().onboardingCompleted) {
// previous users
// Not needed anymore, because AuthProvider already does this
// routeToPage(context, const HomePageWrapper(), replace: true);
routeToPage(context, const HomePageWrapper(), replace: true);
} else {
_goNext();
}
Expand Down
6 changes: 6 additions & 0 deletions app/lib/pages/persona/add_persona.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class _AddPersonaPageState extends State<AddPersonaPage> {
const SizedBox(height: 24),
const Text(
'Your Omi Persona is live!',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 24,
Expand Down Expand Up @@ -366,6 +367,11 @@ class _AddPersonaPageState extends State<AddPersonaPage> {
if (provider.twitterProfile.isEmpty)
GestureDetector(
onTap: () {
if (provider.usernameController.text.isEmpty) {
AppSnackbar.showSnackbarError(
'Please enter a username to before connecting Twitter');
return;
}
routeToPage(context, SocialHandleScreen());
},
child: Container(
Expand Down
6 changes: 4 additions & 2 deletions app/lib/pages/persona/persona_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class PersonaProvider extends ChangeNotifier {
}

Future<void> updatePersona() async {
if (!formKey.currentState!.validate() || selectedImage == null) {
if (selectedImage == null) {
if (!formKey.currentState!.validate()) {
if (selectedImage == null && selectedImageUrl == null) {
AppSnackbar.showSnackbarError('Please select an image');
}
return;
Expand All @@ -125,11 +125,13 @@ class PersonaProvider extends ChangeNotifier {
'name': nameController.text,
'username': usernameController.text,
'private': !makePersonaPublic,
'id': personaId,
};

var res = await updatePersonaApp(selectedImage, personaData);

if (res) {
AppSnackbar.showSnackbarSuccess('Persona updated successfully');
String personaUrl = 'personas.omi.me/u/${usernameController.text}';
print('Persona URL: $personaUrl');
if (onShowSuccessDialog != null) {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/pages/persona/twitter/clone_success_sceen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class _CloneSuccessScreenState extends State<CloneSuccessScreen> {
textAlign: TextAlign.center,
),
const SizedBox(height: 32),
FirebaseAuth.instance.currentUser?.isAnonymous == false
FirebaseAuth.instance.currentUser?.isAnonymous == true
? Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
Expand Down
8 changes: 6 additions & 2 deletions app/lib/pages/persona/twitter/verify_identity_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ class _VerifyIdentityScreenState extends State<VerifyIdentityScreen> {
}

Future<void> _openTwitterToTweet(BuildContext context) async {
final handle = context.read<PersonaProvider>().twitterProfile['profile'];
final tweetText = Uri.encodeComponent('Verifying my clone: persona.omi.me/u/$handle');
var provider = context.read<PersonaProvider>();
var handle = provider.usernameController.text;
if (handle.isEmpty) {
handle = provider.twitterProfile['profile'];
}
final tweetText = Uri.encodeComponent('Verifying my clone: https://persona.omi.me/u/$handle');
final twitterUrl = 'https://twitter.com/intent/tweet?text=$tweetText';

if (await canLaunchUrl(Uri.parse(twitterUrl))) {
Expand Down
2 changes: 1 addition & 1 deletion backend/routers/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async def create_persona(persona_data: str = Form(...), file: UploadFile = File(
data['author'] = user['display_name']
data['email'] = user['email']
save_username(data['username'], uid)
if data['connected_accounts'] is None:
if 'connected_accounts' not in data or data['connected_accounts'] is None:
data['connected_accounts'] = ['omi']
data['persona_prompt'] = await generate_persona_prompt(uid, data)
data['description'] = generate_persona_desc(uid, data['name'])
Expand Down