Abort pinned tab prompt if tab is destroyed

Closes #3223
This commit is contained in:
Jay Kamat 2017-10-31 19:06:39 -04:00
parent dc26808a94
commit cb7e6ab02d
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -259,13 +259,14 @@ class TabbedBrowser(tabwidget.TabWidget):
def tab_close_prompt_if_pinned(self, tab, force, yes_action): def tab_close_prompt_if_pinned(self, tab, force, yes_action):
"""Helper method for tab_close. """Helper method for tab_close.
If tab is pinned, prompt. If everything is good, run yes_action. If tab is pinned, prompt. If not, run yes_action.
If tab is destroyed, abort question.
""" """
if tab.data.pinned and not force: if tab.data.pinned and not force:
message.confirm_async( message.confirm_async(
title='Pinned Tab', title='Pinned Tab',
text="Are you sure you want to close a pinned tab?", text="Are you sure you want to close a pinned tab?",
yes_action=yes_action, default=False) yes_action=yes_action, default=False, abort_on=[tab.destroyed])
else: else:
yes_action() yes_action()