Skip to content

Commit

Permalink
Hotfix: crash when switching account
Browse files Browse the repository at this point in the history
  • Loading branch information
alexal1 authored Jul 9, 2021
1 parent b436a0b commit 60c008f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions insomniac/action_get_my_profile_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def get_my_profile_info(device, username):
profile_view = TabBarView(device).navigate_to_profile()
sleeper.random_sleep()

ActionBarView.create_instance(device)

if username is not None:
if not profile_view.change_to_username(username):
print(COLOR_FAIL + f"Couldn't switch user to {username}, abort!" + COLOR_ENDC)
Expand All @@ -18,9 +20,6 @@ def get_my_profile_info(device, username):
print("Refreshing your profile status...")
profile_view.refresh()
sleeper.random_sleep()

ActionBarView.create_instance(device)

username, followers, following = profile_view.get_profile_info(swipe_up_if_needed=True)
except UserSwitchFailedException as e:
raise e
Expand All @@ -33,6 +32,8 @@ def get_my_profile_info(device, username):
profile_view = TabBarView(device).navigate_to_profile()
sleeper.random_sleep()

ActionBarView.create_instance(device)

if username is not None:
if not profile_view.change_to_username(username):
print(COLOR_FAIL + f"Couldn't switch user to {username}, abort!" + COLOR_ENDC)
Expand All @@ -42,9 +43,6 @@ def get_my_profile_info(device, username):
print("Refreshing your profile status...")
profile_view.refresh()
sleeper.random_sleep()

ActionBarView.create_instance(device)

username, followers, following = profile_view.get_profile_info(swipe_up_if_needed=True)

report_string = ""
Expand Down

0 comments on commit 60c008f

Please sign in to comment.