Skip to content

Commit

Permalink
Merge branch 'main' into chore/fix-flaky-optional-tag-suggestion-dial…
Browse files Browse the repository at this point in the history
…og-test
  • Loading branch information
RisingOrange authored Jan 2, 2024
2 parents e39b39d + 648c923 commit dfe6851
Show file tree
Hide file tree
Showing 8 changed files with 484 additions and 551 deletions.
14 changes: 13 additions & 1 deletion ankihub/gui/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ def _create_collaborative_deck_setup(parent: QMenu):
parent.addAction(q_action)


def _confirm_sign_out():
confirm = ask_user(
"Are you sure you want to Sign out?",
yes_button_label="Sign Out",
no_button_label="Cancel",
)
if not confirm:
return

_sign_out_action()


def _sign_out_action():
try:
AnkiHubClient().signout()
Expand Down Expand Up @@ -459,7 +471,7 @@ def _trigger_install_release_version():

def _ankihub_logout_setup(parent: QMenu):
q_action = QAction("🔑 Sign out", aqt.mw)
qconnect(q_action.triggered, _sign_out_action)
qconnect(q_action.triggered, _confirm_sign_out)
parent.addAction(q_action)


Expand Down
1 change: 1 addition & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ vcrpy==4.2.0
pytest-vcr==1.0.2
pytest-qt==4.2.0
pytest-split==0.8.1
pytest-mock==3.12.0
factory-boy==3.2.1
types-factory-boy==0.3.1
pytest-xvfb==2.0.0
Expand Down
1 change: 0 additions & 1 deletion tests/addon/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
install_ah_deck,
mock_all_feature_flags_to_default_values,
mock_download_and_install_deck_dependencies,
mock_function,
mock_message_box_with_cb,
mock_show_dialog_with_cb,
mock_study_deck_dialog_with_cb,
Expand Down
2 changes: 1 addition & 1 deletion tests/addon/performance/test_exporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def export_notes():

duration = profile(export_notes)
print(f"Exporting {len(notes)} notes took {duration} seconds")
assert duration < 0.1
assert duration < 0.2
Loading

0 comments on commit dfe6851

Please sign in to comment.